* fix(ux): display actual content type instead of hard-coded application/octet-stream
* feat(ux): show file upload when schema has "format: binary", fixes#5636
* feat(ux): show file upload when schema has "format: base64"
According to
https://github.com/swagger-api/swagger-ui/pull/7325#issuecomment-861684260
the uploaded file should be converted to base64 automatically.
* feat(ux): add cypress tests for displaying an upload button
* feat: adds a11y for ContentType & Responses region
* feat: adds a11y to expandable/collapsible elements
* fix: add aria label to select element for content types
* fix: add aria label prop to contentType component
* Change optag to h3 for better tag hierarchy
Co-authored-by: ediiotero <eddie.otero@oddball.io>
Co-authored-by: Mike Lumetta <mike.lumetta@adhocteam.us>
Co-authored-by: Alexander Valencia <alex.valencia@adhocteam.us>
* fix: required properties
schema required properties should not be treated like required: true.
this lead to objects that requires properties being treated as required itself
* test: try-it-out-schema-required-override-allowed
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
* feat: add tryItOutEnabled configuration
allow users to set tryItOutEnabled: true to display
the "Try it out" section by default
tryItOutEnabled to take === "true" for the
query string value or === true if someone
implements query string type parsing in the query
* feat(ux): enhance media-type switching experience in RequestBodyEditor
1. When canceling the try-out mode the request body will be reset to its initial state.
2. When the user switches the media-type in the try-out mode, the experience is as follows:
- If the user did edit the request body the body wont be touched and only media type is updated. This is to ensure that user content is NEVER accidentally overwritten with a default value.
- If the user did not edit the request body it is safe to be replaced by the default value of the target media-type.
Multiple example needed some care in order to allow the retain example value to function properly
* fix(test): workaround cypress issue that can't be reproduced manually
* test: added new feature to ensure enhanced user editing flow
Signed-off-by: mathis-m <mathis.michel@outlook.de>
* ref: #6470
* fixes: #6540
* fixes: #4943
* add example override option to json
* add example override option to xml
* added basic oneOf and anyOf support
* fix anyof|oneof
* only lift xml to items
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
* When the media-type is changed, there is a new `onChangeMediaType` method to handle actions.
* If target schema properties key/value pairs does NOT equals current schema properties, clear the requestBodyValue, try-it-out request/response and validation params.
* If target schema properties key/value pairs DOES equals current schema properties, do not change or re-render schema properties
* oas3Selector `validateShallowRequired` now also validates required keys against target media-type
Fixes#6201, #6250, #6476
* json schema array component should use schema to generate example in case of array items.
* empty value checkbox should be disabled if not empty => not empty list || not empty string
* curl should also check for not empty list
* fix(OAS3): servers component should use nextProps
* test(OAS3): cypress tests for selecting multiple servers
* test(OAS3): multiple server test with definition change
fixes#5181
* application/json
* application/xml
* application/x-www-form-urlencoded
* Set requestBodyValue values to be an immutable Map, as "value". Previously stored as a normal String.
* This enables adding "errors" to the Map, for validation use
* note: getOAS3RequiredRequestBodyContentType requires state.spec,
* which is not available to state.oas3
bug: JsonSchema components should validate schema properties exists
- schema
- type
- format
- enum
bug: fix a debounce error in JsonSchema_string if value is null
ft: new simplified JsonSchemaArrayItemText component
test: use immutableJS for `json-schema-form` test
test: add dev scripts to run `cypress open`
test: new cypress `schema-form` tests
* clears authentications when logout is clicked
* tests the headers sent in the network request
* adds test for multiple api keys
* refactors tests to extract common uses
* correct test message description
Co-authored-by: kyle shockey <kyleshockey@gmail.com>