* fix(request-snippets): prevent scrolling errors from missing function
* refactor(request-snippets): migrate to functional component
* fix(curl): remove undefined prop and function
* test(live-response): fix import of RequestSnippets
Makes the last `initOAuth` variable configurable via environment
variables in the swagger-ui docker image.
Co-authored-by: Christopher Giroir <chrisgiroir@improbable.io>
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
Reading configuration parameters from URL search params
is by default no longer enabled. To re-enable it, set queryConfigEnabled
configuration parameter to true.
Functionally, this is a breaking change, but given we're just providing
a security vulnerability patch we're considering this a PATCH version bump
only.
Refs #4872
Refs https://github.com/swagger-api/swagger-ui/security/advisories/GHSA-qrmm-w75w-3wpx
- Update tabs to use <button> elements instead of <a>
- Add aria roles for tablist, tabs, and tabpanel
- Add aria attributes for additional a11y compliance and screen reader accessibility
- Replace ids with data-name attribute for tabpanels
- Add cypress test 7463 and update swos-63
- Move tabs test file to tests/a11y directory
- Rename test file to be more descriptive of what is being tested.
- Add id attributes to both tabs and tabpanels to leverage aria-controls and aria-labelledby attributes
Co-authored-by: Calvin Gonzalez <calvin.gonzalez@oddball.io>
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
Closes#7463
Refs #7350
* 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
This commit provides a backward compatible mechanism to chain wrap
an individual component multiple times
`Chain` mode: allow chaining of plugins on a given component
`Legacy` mode: last plugin to wrap a given component will supercede others
* chore: Add unit test for wrapComponent wrapping
* doc: Add documentation about the new pluginsOptions configuration
* doc: Add a sidenote on plugin-api page
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
* 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(sample-gen): yaml sample generation
if content / media type matches yaml or yml it will generate stringified sample like for json
in addition to that it will generate yaml out of the json sample
Signed-off-by: mathis-m <mathis.michel@outlook.de>
* test(unit-jest): getSampleSchema should handle yaml
* 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>