Commit Graph

51 Commits

Author SHA1 Message Date
kyle
971c6f7536 fix: path-item $ref produces/consumes inheritance (via #5049)
* implement a selector for consumes options

* fix incorrect comment, test names

* add `consumesOptionsFor` selector

* use `consumesOptionsFor` and drop `operationConsumes`
2018-11-23 23:24:11 +01:00
kyle
074eaa5d51 fix: prevent object inheritance mutations in recursive sampleXmlFromSchema calls (via #5034)
* fix: prevent object inheritance mutations in recursive sampleXmlFromSchema calls

* fix unrelated test
2018-11-16 21:02:23 +01:00
Helen Kosova
89868a85bb feat: sample value generation for uuid, hostname, ipv4, & ipv6 formats (via #5033) 2018-11-16 13:22:42 +01:00
Jeremy Hayes
078bca3566 feat: sample value generation for date formats (via #5024) 2018-11-16 00:49:23 +01:00
kyle
ad786b023f housekeeping: .js -> .jsx file extensions (via #5014)
* housekeeping: `.js` -> `.jsx` where necessary
2018-11-08 16:37:21 +00:00
Tim Macfarlane
9a9cfdf101 improvement: omit deprecated fields in examples (via #4758) 2018-08-20 14:11:50 -07:00
kyle
87296702c6 feature: allowEmptyValue controls (#4788)
* add baseline tests

* coerce empty strings to null when updating parameter values

* add ParameterIncludeEmpty

* add redux management for empty parameter value inclusion state

* use name+in keying for state management instead of hash keying

* update new redux method usages to name+in keying

* coerce empty Immutable iterables in onChangeWrapper

* OAS3 tests & support

* add included empty parameters to requests before dispatching to Swagger Client

* make empty inclusion interface prettier

* add tests for #4587

* linter fixes

* check for truthy value before reaching into property
2018-08-04 01:26:07 -07:00
kyle
21b0037529 improvement: handle more invalid Swagger/OpenAPI version values gracefully (#4699)
* improvement: handle more invalid version values gracefully

* use source maps in Mocha tests

yields accurate stack trace line numbers
2018-07-05 12:23:36 -05:00
kyle
9d02a7d8ad fix(sample-gen): respect null values in examples (via #4679)
* improvement: re-enable and improve Models jump-to-path

* fix(sample-gen): respect null values in examples
2018-06-27 19:40:00 -07:00
kyle
8e295c23a4 Improvement: Hash-keyed Try-It-Out parameter value storage (#4670)
* allow param update by identity + hashed value storage

* add specActions.changeParamByIdentity

* add identity-based lookup support in spec selectors

* migrate `changeParam` usage to `changeParamByIdentity`

* migrate usage of `parameterWithMeta` to `parameterWithMetaByIdentity`

* update invocations of `changeParamByIdentity` to match fn signature

* use OrderedMap throughout hash-based selectors for consistency

* normalize usage of ParameterRow `onChange`

* migrate bug 4557 tests to reflect new ParameterRow interface

* remove exclusive test blocks

* linter fixes

* copy Parameters changes into OAS3 wrapper

* use rawParam for meta lookups in ParameterRow
2018-06-21 21:36:38 -07:00
Sofiia
8416b043ea housekeeping: factor out components for easier BaseLayout reuse (#4604)
* improve: wrap schemes to encapsulate rendering logic
* improve: wrap filter to encapsulate rendering logic
* improve: wrap info section to encapsulate rendering logic
* improve: wrap servers plugin to encapsulate rendering logic
* improve: added tests for schemes-wrapper rendering logic
* improve: added tests for info-wrapper rendering logic, also do not render info if info is undefined
* improve: added tests for filter rendering logic
* improve: added tests for servers-wrapper rendering logic
* `InfoWrapper` -> `InfoContainer`
* add `containers` alias to Babel configuration
* `SchemesWrapper` -> `SchemesContainer`
* drop `container` from container file names
* `ServersWrapper` -> `ServersContainer`
* `Filter` -> `FilterContainer`
* follow `core/containers` pattern in BasePreset
2018-06-14 19:06:20 -07:00
kyle
f53f92351e fix: sample generation for nested oject schemas (#4648) 2018-06-14 16:56:03 -07:00
kyle
7049de6201 v3.14.0 (#4492)
* v3.14.0

* fix: simplify config fetch interceptor implementation

* add `loadRemoteConfig` flag to requests

* v3.14.0
2018-04-27 23:20:13 -07:00
kyle
62354568a9 feat: request/response interceptors for remote config fetch (#4484) 2018-04-26 21:04:55 -07:00
kyle
3efdf1223e fix: add additionalQueryStringParams to auth requests (#4419)
* tests: add failing unit tests

* fix: add additionalQueryStringParams to auth requests
2018-04-06 20:00:10 -07:00
Luka Žitnik
e2d8a4e396 Fix(auth): improper resolution of relative token urls (#4180)
* fix(auth): improper resolution of relative token urls

* revert cc58ba7 for OAS2

In OAS2, relative token URLs are resolved against the host that serves the specs.
2018-04-05 19:20:20 -07:00
kyle
fd8274b353 Filter $$ref from examples (#4392)
* fix(dev-server): don't open localhost in a browser
* tests: refactor model-example enzyme tests to be more isolated
* tests: add failing sampleFromSchema tests for $$ref keys
* tests: add additional test for user-created $$ref values
* fix: create deeplyStripKey; use it to filter $$refs out of examples
* tests: add cases for deeplyStripKey
2018-03-30 18:02:32 -07:00
kyle
8189fd2473 fix: path item $ref rendering (#4381)
* WIP: trigger resolution of Path Item $ref on spec load

* fix(dev-server): don't open localhost in a browser

* preserve key order when merging specJson with specResolvedSubtrees

* remove stray `debugger`
2018-03-27 17:04:31 -07:00
kyle
245428e7cd feat: preauthorization (#4339)
* feat: swagger 2.0 preauthorization methods
* tests: add cases for oas3 preauthorization
* docs: add new preauth docs; touch up existing auth docs
* tests: add `rootInject` tests
* docs: remove unfinished sentence
2018-03-16 22:25:04 -07:00
Pavel Stefanov
b13b05e416 improve: support for oneOf and anyOf in array sample (#4136)
* Fixed oneOf and anyOf in array example

* Added tests for sampleFromSchema for array type

* Removed return example for array item
2018-03-02 16:42:51 -08:00
kyle
1fb56c6f96 fix: Try-It-Out Consumes value regression (#4265)
* Migrate behavior of `operationConsumes` selector

* Improve accuracy of resolved subtree merger

* Check for Immutable Map _before_ using `get` method
2018-02-27 18:55:59 -08:00
David Vujic
e6722d87aa improve: filter as a plugin (#4255) 2018-02-27 15:44:30 -08:00
kyle
ecf688171f feat: lazy resolver (#4249)
* default to empty `ImmutableMap` when grabbing op metadata
* pass `errors` into JsonSchema components
* Account for Immutable data structure in JavaScriptonSchema...
    ...and create empty Lists instead of Maps by default.
* Pass ImmutableList through to JsonSchema child components
* Add lazy resolving spec state extensions
* TEMPORARY: disable conventional resolved spec
* WIP
* Use resolveSubtree in Operation display
* Freebie: short-circuit Markdown component if it is given plaintext
* NEW DEFAULT BEHAVIOR: `defaultModelsExpandDepth: 1` does not expand individual models
* Render faked Model expander to trigger resolution
* Baseline support for Editor lifecycles
* Display operation summaries before the operation is resolved
* Test migrations
* WIP
* Swagger2 TIO Body params
* a bit of cleanup
* Debounce string param inputs
* Reach into unresolved operation for deprecated flag, if available
* Fire subtree request outside of render
* Remove debugging flags
* Fix logical errors in spec statePlugins
* TODOs become TODONEs!
* Migrate deeplinking feature to non-resolved spec action
* ESLint fixes
2018-02-23 01:12:53 -08:00
kyle
7af7121e64 fix: streamline management of user-selected produces and consumes values (#4137)
* Remove produces/consumes setter from OperationContainer

* Store consumes/produces information in `meta` key

* Migrate produces value state usage to `meta` key

* use meta consumes data for isXml check

* Fix failing tests

* normalize action name casing

* restore correct produces fallback value logic
2018-01-18 20:37:44 -06:00
Kyle Shockey
b3c549055d Remove describe.only 2017-11-30 15:58:26 -08:00
Kyle Shockey
efd02106a2 Support namespaces in OAS3 server state 2017-11-30 15:57:37 -08:00
Kyle Shockey
ab7af75ab4 Add OAS3 state tests 2017-11-30 15:30:37 -08:00
Kyle Shockey
531d0337ac Remove describe.only 2017-11-06 22:13:29 -08:00
Kyle Shockey
3536f2d518 Add tests for modified selectors 2017-11-06 22:08:42 -08:00
Kyle Shockey
075c94f68c Remove describe.only 2017-10-21 11:13:01 -07:00
Kyle Shockey
8b81bcac48 OAS3 Auth MVP 2017-10-11 16:58:24 -07:00
Owen Conti
7ef8a7ddc7 Merge branch 'master' of github.com:swagger-api/swagger-ui into bug/3511-query-formData-parameters
# Conflicts:
#	src/core/components/parameter-row.jsx
#	src/core/plugins/spec/actions.js
2017-09-18 16:59:08 -06:00
Kyle Shockey
5bc096d32b Fit linter and tests 2017-09-08 18:44:11 -07:00
Mike Gilbode
087ed20384 Add support for requestInterceptor / responseInterceptor.
- Display mutated requests from request interceptor in curl output in UI.
  Put this behind showMutatedRequest flag so that the mutation can be
  silent.
- Document requestInterceptor, responseInterceptor and showMutatedRequest
  in README.md
- Add tests
2017-08-13 01:14:41 -04:00
Owen Conti
7a694e287a Change name format to in.name and update tests 2017-08-03 19:29:49 -06:00
Kyle Shockey
9af5d2dc66 Add writeOnly support to sampleFromSchema; add tests for the same 2017-08-03 17:23:16 -07:00
Kyle Shockey
37f9d5aa29 Add tests 2017-08-03 17:13:58 -07:00
Owen Conti
ce8adb91a5 Fix failing selector test 2017-08-03 07:14:03 -06:00
Owen Conti
991ae66b39 Fixes #3375 - Change order of logic for selecting requestContentType to prioritize consumes_value first 2017-07-12 19:56:11 -06:00
shockey
b72aa3a7c8 Merge branch 'master' into webpack-migration-2.x 2017-06-29 18:23:36 -07:00
RVKen
d36f0a6dbd fix eslint issues 2017-06-29 04:37:19 +02:00
Owen Conti
ddb5704637 #3072 - Display response body and headers for requests that result in non-200 responses. Add test to ensure error and response are merged correctly 2017-06-25 13:28:14 -06:00
shockey
754d57396a Merge branch 'master' into bug/2919-relative-spec-infer-scheme 2017-04-18 19:55:29 -07:00
Kyle Shockey
5fc064e2ac Reorganize tests 2017-04-18 15:08:36 -07:00
Kyle Shockey
35769f9b47 Fix #2918; add control/test tests 2017-04-18 11:20:15 -07:00
Kyle Shockey
4c1a5488bb Parse spec url when deciding scheme for operation 2017-04-13 17:26:47 -07:00
Kyle Shockey
8dd23053b2 Merge branch 'master' of github.com:swagger-api/swagger-ui into ft/linting-and-testing 2017-03-23 16:43:37 -07:00
Kyle Shockey
e1fcbfbf09 Linter error fixes 2017-03-23 16:36:45 -07:00
Kyle Shockey
f1f239b07b Delete unused AST tests 2017-03-22 21:22:07 -07:00
Anna Bodnia
4ebe2273da fixes for XML render 2017-03-22 16:14:20 +02:00