Commit Graph

80 Commits

Author SHA1 Message Date
Vladimir Gorej
7dd167b626 docs(setting-up): reword how SwaggerUI reflects Node.js releases (#8142)
Refs b89e88579c
2022-08-17 10:58:06 +02:00
Andreas Deininger
9891d97201 docs: fix typos and update https references (#8154)
Co-authored-by: Tim Lai <timothy.lai@smartbear.com>
2022-08-12 10:14:27 -07:00
Tim Lai
b89e88579c fix(jsdom): cumulative Jest updates with support for TextEncoder/TextDecoder (#8111) 2022-07-20 13:15:06 -07:00
twjasa
77d0bb960b feat: add modelcollapse to primitive models (#7557)
* update: primitive-model test with modelcollapse

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-21 14:50:14 -07:00
Christopher Giroir
c81d7f0f30 feat(docker): add OAUTH_USE_BASIC_AUTH env (#7474)
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>
2022-03-21 13:53:07 -07:00
Maciej Kowalski
8f63462f9e feat(oauth2): authActions.authPopup plugin accessible wrapper (#7699)
* enables win.open to be extensible by plugins

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-10 14:44:46 -08:00
dewijones92
3d79c24949 fix(examples): allow string created by regex pattern (#7829)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-03 16:31:00 -08:00
Mahtis Michel
2b30a3478d feat(requestSnippets): handle type: string, format: binary or base64 file upload data (#7545)
* test(curlify): assert that data-binary is generated

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-01-31 11:34:45 -08:00
Vladimir Gorej
8b1c4a7c1a feat(error-handling): introduce unified and configurable error handling (#7761)
Refs #7778
2022-01-24 16:12:13 +01:00
Vladimir Gorej
01a3e55960 fix(security): disable reading config params from URL search params (#7697)
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
2021-12-09 17:28:17 +01:00
Vladimir Gorej
b299be764f fix: introduce Error Boundaries to handle unexpected failures (#7671)
Two new components have been updated via plugin system: ErrorBoundary and Fallback.
These components can be overridden by user plugins.

Refs #7647
2021-11-25 13:47:22 +01:00
Vladimir Gorej
fb7e98a431 fix(servers): prevent UI crash when chaning Server with variables
Closes #7525
2021-11-04 16:27:27 +01:00
Vladimir Gorej
e3640739a4 fix(root-inject): handle errors in functional components properly 2021-11-03 09:49:50 +01:00
Vladimir Gorej
8c79e2a375 refactor: prefix lifecycle methods with UNSAFE_
Refs #7341
2021-11-03 09:49:50 +01:00
Vladimir Gorej
14f9b40ef2 test(test:unit-jest): fix all failing tests for this script
We needed to align new cheerio and enzyme
APIS with tests.

Refs #7341
2021-11-03 09:49:50 +01:00
Helen Kosova
f1aab53dd6 fix(sample-gen): generate the correct number of properties (#7432)
This commit fixes correct number of additionalProperties when minProperties is used.
2021-09-15 15:54:26 +03:00
Vladimir Gorej
96cdf00adb fix(system): allow wrapping selectors in chain (#7304)
Refs #7157
2021-05-26 11:54:58 -07:00
Damien
516e666f1c feat(wrapComponents): new chain configuration option (#7236)
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>
2021-05-20 15:41:11 -07:00
Giles Wells
72811bd827 feat: Accessibility improvements (#7224)
* 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>
2021-05-12 09:40:31 -07:00
Michael Zangl
5906dfae02 fix(authorization): include oauth endpoint description (#7195) 2021-04-20 16:39:11 -07:00
Tim Lai
f5b84e59ce feat: markdown sanitization of form tag (#7146) 2021-03-31 11:03:57 -07:00
Mahtis Michel
4103e0f919 fix: array constraint validation only if value was provided (#7112) 2021-03-30 12:33:56 -07:00
Mahtis Michel
3ead825287 feat: sample gen should incorporate schema validation constraint (#7043)
* feat(sample-gen): handle minProperties, maxProperties

* fix(sample-gen): lift required

* feat(sample-gen): handle minimum, maximum (+ exclusive)

* feat(sample-gen): handle minLength, maxLength
2021-03-10 13:19:45 -08:00
Mahtis Michel
902241cf7e fix(sample-gen): xml attr with media-type example value (#7045) 2021-03-10 12:44:54 -08:00
Mahtis Michel
f9e54a26bf fix(sample-gen): allOf, oneOf lifting should consider properties and items (#7041) 2021-03-10 11:18:54 -08:00
Mahtis Michel
8405fa0101 feat: request snippets plugin (#6910) 2021-03-10 11:02:34 -08:00
Dan Dumont
f23a9d6924 fix(auth): support pkce when using basic auth header (#7038)
* support pkce when using basic auth header

* test(auth): useBasicAuthenticationWithAccessCodeGrant + usePkceWithAuthorizationCodeGrant
2021-03-10 10:30:20 -08:00
Mahtis Michel
7ead9baa80 * fix(sample-gen): enum without type should be handled by sample-gen (#6912) 2021-02-11 09:58:28 -08:00
Chad Killingsworth
5e69d3c4f2 fix: support OAuth2 PKCE when using the OIDC authorization_code flow (#6914)
* Previous checks only supported the OAuth2 authorizationCode flow and missed the equivalent OIDC flow.
2021-02-10 09:52:35 -08:00
Mahtis Michel
5b2ad68f50 fix(sample-gen): case yaml parsed example is number but string schema (#6872) 2021-01-28 09:04:15 -08:00
Kyle Hoskins
265bdc07b7 feat: add tryItOutEnabled configuration (#6865)
* 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
2021-01-26 09:00:38 -08:00
Mahtis Michel
470e2fed9b feat(sample-gen): yaml sample generation (#6858)
* 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
2021-01-25 14:43:52 -08:00
Tim Lai
a5eb3dc0c3 fix(buildUrl): relative url is invalid URL (OAS3) or non-url (OAS2) (#6864)
* OAS3: relative url when no servers defined AND specUrl is invalid Url

* OAS2: specUrl is non-url string
2021-01-22 16:55:37 -08:00
Mahtis Michel
a2f7917661 fix(sample-gen): should return json literal example (#6827)
* fix(sample-gen): should return json literal example

* test(sample-gen): should return json literal example
2021-01-14 10:59:35 -08:00
Ihnat Klimchuk
2f8bfd03f8 feat (auth): support for flow type authorization_code in oauth2-redirect.html (#6750) 2021-01-12 20:02:04 -08:00
Mahtis Michel
59b42bb38f fix(sample-gen): should return xml literal example (#6822) 2021-01-12 19:01:44 -08:00
Mahtis Michel
25433c4864 fix(spec-selector): isMediaTypeSchemaPropertiesEqual should handle case where literal media-types are equal. (#6820)
* fix(spec-selector): isMediaTypeSchemaPropertiesEqual case same

should return true in case of comparing same media types.

* test(spec-selector): isMediaTypeSchemaPropertiesEqual tests
2021-01-12 18:31:51 -08:00
Mahtis Michel
35cb92502a fix(sample-gen): should render additionalProperties in example (#6821)
* fix(sample-gen): should render additionalProperties in example

* test(sample-gen): should return additional property from example
for object and array schemas
2021-01-12 17:55:23 -08:00
Mahtis Michel
0f541a1ab0 fix(sample-gen): first oneOf or anyOf should be combined with schema (#6775)
* fix(sample-gen): oneOf and anyOf should be merge into schema

when there was oneOf or anyOf defined it just used the first schema of it to generate the samples.
Now, the first oneOf or anyOf is combined with the schema to generate samples.

* test(sample-gen): oneOf and anyOf should be combined with schema
2021-01-07 11:26:34 -08:00
Ilya Lipnitskiy
0807687f91 feat(auth): Add OIDC support (#3517) (#6549)
spec/actions.js: Add OIDC metadata fetching

components/auth/oauth2: Add OIDC URL to the Authorization popup
2020-12-09 10:11:33 -08:00
Tim Lai
d2ef8f31b9 fix(examples): properly update memoized value in non-schema case (#6641) 2020-11-19 13:55:32 -08:00
dalbrx-forcam
6db4def00a fix: externalDocs url for tags when using swagger v2.0 (#6579)
* added operation tag test
2020-11-03 11:18:08 -08:00
Mahtis Michel
288c89bdbb fix(schema example): xml gen should follow json gen behavior (#6555)
* 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>
2020-11-03 10:58:59 -08:00
Shelby Sanders
6a4e52aadb feat: support for showExtensions on Response objects (#6535) 2020-10-21 18:49:39 -07:00
Tim Lai
671e945376 test(jest): cleanup console warnings/errors (#6547) 2020-10-21 17:35:33 -07:00
Tim Lai
0a807d6237 fix(auth): support for oauth2 relative url (#6546)
* Handle relative urls for oauth authorization

The full URL is computed based on the current selected server
if a relative URL is used as authorizationUrl
or tokenUrl


Co-authored-by: Eliot Berriot <contact@eliotberriot.com>
2020-10-21 15:46:31 -07:00
Theo Markovic
537ad6d6bf fix(jest): add stub for errActions to prevent unhandled promise rejections #6365 (#6495)
Co-authored-by: Theo Markovic <theodore.markovic@svenskaspel.se>
2020-10-14 17:07:49 -07:00
Tim Lai
3905fadfbe fix(oas3): switching media types should update schema properties (#6518)
* 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
2020-10-14 16:24:07 -07:00
Tim Lai
797929f1cf fix(parameter-row): rendering of default/example values of 0 (#6454)
Co-authored-by: @danxmoran
2020-10-01 16:28:55 -07:00
Mahtis Michel
ad630cc3e0 fix: sample schema should stringify string values for content-type: text/json (#6431)
* reverts #6412 which stringified string value if content-type: text/plain 
* enable stringify string values matching `/json/` and allowList of `shouldStringifyTypes` ("string")
2020-09-29 13:40:47 -07:00