Commit Graph

43 Commits

Author SHA1 Message Date
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
955352251b fix(try-it-out): stringify numerical initial values in ParameterRow (#4767)
* add failing tests
* coerce initial values to string
* only convert numbers to strings when setting parameter values
2018-07-27 01:17:36 -07:00
kyle
478d93ae08 Example (#4730)
* add tests for example feature
* refactor ParameterRow value setter logic
* aside: fix property access in sampleFromSchema
* prioritize media type examples for OAS3 responses
* use `example` in schema level example
* refactor: move stringify to utils
* prioritize media type examples in OAS3 request bodies
* modify nightwatch config
* fix parameter/response regressions
* reorder and broaden default value sources
* update lockfile
2018-07-14 03:09:37 -04:00
kyle
bbbd1b93cb fix: OAS3 array item value input (#4729)
* fix: OAS3 array item value input
* linter fixes
2018-07-14 02:12:00 -04: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
kyle
43304aa80a feat: OAS3 binary media type support (#4592)
* fix(validator-badge): resolve definition URLs against browser location

* use param as meta parameter if not found

* convert request body from Immutable if necessary

* show file upload for `format: binary` and `format: base64` jsonschema strings

* add `dispatchInitialValue` prop to JsonSchemaForm

* add optional subkey parameter to onChange

* add binary media type support to request body
2018-05-25 20:37:58 -07:00
kyle
c8480a827a fix: respect OAS3 parameter default values (#4561)
* add test cases

* refactor default setters into own function

* reach into `schema` for default value in OAS3

* remove exclusive test
2018-05-16 00:27:14 -07:00
Helder Sepulveda
cbff0251ae feat: option to show common query parameters (#4245)
* extend getExtensions

Add optional param to getExtensions that can retrieve more stuff

* Add getCommonExtensions

* Trim trailing spaces

* Remove unused parameter

* Move the format inline with the param type

* correction to UnitTest
2018-04-26 21:18:45 -07:00
Aleksey Ganzha
26d0ad7684 fix(regression): model rendering for Swagger 2.0 body parameters (#4424)
* Fix model rendering for parameters

* tests(e2e): add test confirming that Pet model is shown in operation
2018-04-13 16:57:32 -07:00
David DE CARVALHO
39d34523b9 Improve enum values for Enum Type in Swagger ReadOnly documentation (#4191)
* Adding enum values for Enum Type in Swagger ReadOnly documentation

* Adding enum values for Enum Type in Swagger ReadOnly documentation (optimisation) and also adding default/example value

* Add new display enums, defaults, and examples when not in TIO mode (another way to have enums values in swagger.json)

* Fix npm test result

* review corrections

* fix: don't render parameter description if field is empty

* use cross-version schema variable to access properties

* pass className through Markdown component usage

* add per-field classNames to Markdown for easier styling + testing

* remove parameter Example field (out-of-scope for this PR)

* get default value from schema instead of top-level parameter

* tests: add e2e cases for swagger2 and oas3

* remove `swagger-petstore-enum.json`

the purpose of this file lives on in the e2e test specs folder

* add missing proptypes validation

* use `classnames` to more effectively union class names
2018-04-05 18:48:19 -07:00
kyle
d90353228a pass meta error information to JsonSchemaForm correctly (#4416)
* tests: add failing e2e tests

* fix: pass meta error information to JsonSchemaForm correctly
2018-04-05 15:30:31 -07:00
kyle
83232dc2d8 v3.12.0 (#4282)
* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options

* Don't default to empty Map when getting subtree

* fix(validateParam): check for ImList type before using count method

* Use `replaceState` to update `urls.primaryName`

This gives us the stateful URL we want, without:
(a) refreshing the page on update
(b) creating a long, useless history for the user
(c) implying that browser history is two-way bound
    to Swagger-UI (it isn't, we don't have a router)

* Add `fn.opsFilter` docs and internal API versioning note

* restrict `x-example` functionality to Swagger 2.0

* polish Authorize + Close buttons

* add tachyons; use it for padding the new Reset button

* v3.12.0

* rebuild dist
2018-03-02 21:13:00 -08:00
Davide Zipeto
4900b11079 feature: read the x-example field and use them as values (#3538)
* Read the x-example field and use them as values
Allow to show the value defined in the "x-example" field when pressing try-out. The "default" value will have the precedence over the x-example

* Use `parameterWithMeta` to get parameter data in <ParameterRow>
* Prefer specPath when fetching resolved subtrees in OperationContainer
* Add test for OAS3 callback rendering
* Remove debugger statement
* Pass base resolution URL directly to Swagger-Client subtree resolver
* Remove accidental comment
* Migrate additional options
* Don't default to empty Map when getting subtree
* make "default" and "x-example" mutually exclusive
"x-example" wins when both are present
* limit "x-example" to non-body parameters
2018-03-02 18:31:08 -08:00
kyle
22036b1fbf fix: OAS3 parameter value input bug (#4271) 2018-02-28 16:30:20 -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
1e1b7f6063 fix(try-it-out): pass Parameter validation messages around in props for OAS3 (#4162)
* 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
2018-01-25 20:14:35 -08:00
Helen Kosova
179699277d fix(parameter-rendering): improve punctuation and spacing (#4145) 2018-01-23 16:33:27 -08:00
David DE CARVALHO
a47da98b54 feat(render/parameters): display enums, defaults, and examples when not in TIO mode 2018-01-05 22:09:32 -06:00
Kyle Shockey
9bad35ed85 Refactor specPath to Im data structures to avoid waste renders 2017-12-28 18:04:12 -06:00
kyle
bfb4c7a8d7 Merge branch 'master' into feature/spec-path 2017-12-07 16:49:34 -08:00
Greg Thompson
91dab7b166 getConfigs prop expansion; limit extension render based on config setting 2017-11-09 10:22:41 -06:00
Greg Thompson
45a0295c0e use correct immutable map size 2017-11-08 08:52:34 -06:00
Greg Thompson
44c422eba3 parameter extensions display 2017-11-06 09:17:30 -06:00
Josh Ponelat
009ee1d9fb propagate specPath through parameter-row 2017-11-03 17:50:46 +02:00
Josh Ponelat
91d4ab96d7 partial specPath changes 2017-11-03 17:50:46 +02:00
Kyle Shockey
2157988212 Don't reach into schema for value 2017-10-27 23:31:47 -07:00
Kyle Shockey
79ddae1526 Pass correct schema values to parameter state builder for OAS3 2017-10-27 22:23:11 -07:00
Kyle Shockey
631e69f6f8 Pass parameter.schema as schema in OAS 3.0
Parameters were restructured in OAS 3.0; schemas are no longer at
the top level of parameters. Adjusting to account for the change.
2017-10-20 16:01:26 -07:00
kyle
263f6feb2f Merge branch 'master' into ft/default_model_rendering 2017-09-29 13:29:04 -07:00
Owen Conti
31e7ce0c5e Fixes #3706
Add missing "in" argument to `getParameter`
2017-09-25 21:26:44 -06:00
Owen Conti
fd00a0489a Remove shouldComponentUpdate from parameter-row component. It will be put back in eventually as part of the performance optimizations once the parameter components are converted to the smart/dumb approach. 2017-09-23 13:10:09 -06: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
Owen Conti
408e038b2d fromJS does not maintain order of object properties. Use a reviver function with fromJS inside the response.jsx component for the passed down schema prop. 2017-09-11 20:28:58 -06:00
Mike Gilbode
d7ae284a0c Add defaultModelRendering parameter. 2017-08-30 23:30:57 -04:00
Kyle Shockey
1eab4b3b20 Display OAS3 parameter types 2017-08-10 22:55:41 -07:00
Kyle Shockey
35733b5eb4 Indicate parameter deprecation 2017-08-04 15:39:48 -07:00
Owen Conti
fdb0d13089 Fixes #3511 - Update changeParameter calls to accept in value to identify parameters based on name plus in value 2017-08-02 22:07:48 -06:00
sharkpp
ff41b30171 fixing Non-ascii character class name
Fixed to LATIN SMALL LETTER A because class name contained CYRILLIC
SMALL LETTER A.
2017-07-08 01:19:03 +09:00
RVKen
d36f0a6dbd fix eslint issues 2017-06-29 04:37:19 +02:00
Kyle Shockey
23b1a8aabd Finish rewiring Markdown provider 2017-06-01 21:41:28 -07:00
Kyle Shockey
df47e0e956 Disable HTML rendering in React-Markdown 2017-06-01 09:43:13 -07:00
Anna Bodnia
7e1eb4e9a7 fix #2841 2017-05-04 17:18:47 +03:00
Ron
f22a628934 in with the new 2017-03-17 21:17:53 -07:00