Commit Graph

2321 Commits

Author SHA1 Message Date
Tim Lai
b7d3d1ce4a fix(info): use externalDocsUrl check to render Link (#6997)
* fixes screen reader accessibility issue
2021-02-24 15:56:24 -08:00
Mahtis Michel
4db2edcad2 feat: verbose Failed to fetch error (#6938)
* feat: verbose Failed to fetch error

* refactor: disable console.error in src/core/plugins/spec/actions.js

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2021-02-24 14:32:25 -08:00
Mahtis Michel
0e6dc0487c feat(models): collapsed schema content should be clickable (#6942) 2021-02-16 16:02:55 -08:00
Mahtis Michel
a2a561e943 feat: validate nullable (#6928) 2021-02-11 10:18:13 -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
Mahtis Michel
fad81f8cb9 feat: use example gen for multiple example value retainer examples (#6920)
* fix: multiple examples with same value jumps to first example
2021-02-11 09:33:04 -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
Nicolas
13fea13397 fix(responseBody): json response highlighting (#6871)
Refs #6508 

* Add language prop to HighlightCode component

* Use language prop for JSON HighlightCode responses in response-body.jsx
2021-02-03 12:56:29 -08:00
Mahtis Michel
5c4dfc2da8 feat: enhance parameter validation (#6878)
* feat: support min/max items validation

* feat: validate array deep and unique items

* feat: validate object deep
2021-02-03 12:29:59 -08:00
Mahtis Michel
8ed6c34958 feat: sample-gen mulit and form media-type (#6874)
* application/x-www-form-urlencoded || **multipart/** initial value should rely on sample gen
2021-02-03 12:04:12 -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
Mahtis Michel
e877580d54 feat(ux): enhance media-type switching experience in RequestBodyEditor (#6837)
* 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>
2021-01-25 11:16:07 -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
eddde95dc4 fix(ux): ensure that optional security schema is rendered without padlock. (#6839) 2021-01-22 10:03:38 -08:00
Mahtis Michel
ddaee4ec42 feat: group / sort parameters by location (#6745) 2021-01-14 11:39:01 -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
Mahtis Michel
7087210adb fix(style): code should should wrap line (#6831)
* fix(style): code should should wrap line

this time in correct place

* revert(#6764): reverted wrongly placed css
2021-01-14 10:11:03 -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
2bf39e0ad5 feat(ux): Disabled Execute button while request is in progress (#6776)
Avoid sending multiple request while old is in progress

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2021-01-07 11:41:55 -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
Mahtis Michel
85a3ec983e fix(style): response data flows off the screen (#6764) 2021-01-04 10:44:48 -08:00
Mahtis Michel
68e9b1b439 Request Body examples should respect media-type (#6739)
* fix: request body.jsx should rely on the getSampleSchema utility

* test: add test to ensure xml request body
2021-01-04 10:23:23 -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
geraldglynn
20a89877b2 fix(components): fix keys rendering in React 16 using .entrySeq() (#6685) 2020-12-09 16:12:58 +01:00
Tim Lai
d2ef8f31b9 fix(examples): properly update memoized value in non-schema case (#6641) 2020-11-19 13:55:32 -08:00
Tim Lai
24225e47bf fix(xml): example generation if an array has an example (#6634)
ref: #6627
2020-11-18 15:19:52 -08:00
geraldglynn
1f10240a97 fix: duplicate labels in Servers UI (#6568) 2020-11-03 12:40:11 -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
Aleksandr Zhuravlev
50e5f653cc fix: duplicate downloading of remote config (#6544) 2020-10-21 17:57:31 -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
Andrew Korshunov
5a87c8a932 fix(auth): Allow PKCE for legacy AccessCode OAuth2 Grant Type (#6011)
fixes #6010

Co-authored-by: Andrew Korshunov <andrew.korshunov@vizsc.com>
2020-10-20 13:48:44 -07:00
Adam Stachowicz
8e3e059aa1 fix: add additional autoFocus for http-auth component (#6527)
* Addendum to commit 65ea764b, in PR #6483
2020-10-16 14:19:52 -07:00
Mahtis Michel
87ab4e9ac9 fix: response examples should respect media-type (#6456)
* response sample generation should take content type into consideration for stringify
2020-10-16 13:52:21 -07:00
Lucia Sarni
5065613130 fix(requestBody): hide read only properties (#6490) 2020-10-15 11:25:06 -07:00
Lucia Sarni
99fda81ae0 fix: missing commas in response header values #6183 (#6515) 2020-10-14 19:37:12 -07:00
Adam Stachowicz
65ea764b61 fix: add autofocus to auth fields (#6483) 2020-10-14 19:23:19 -07:00
Francesco Franchina
4b2fddd8ed fix(style): preventing long strings from overflowing (#5934) (#6507) 2020-10-14 18:49:33 -07:00
Matthew Chan
1af8678ae1 fix(jest): unknown prop initialValue on input tag (#6506) 2020-10-14 17:24:36 -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
Lucia Sarni
6c5e91dece fix: deprecate from "new Buffer" to "Buffer.from" (#6489) 2020-10-08 14:40:46 -07:00
Lucia Sarni
aa53ec24b8 fix(filter): avoid filtering by the strings "true/false" when enabled (#6477) 2020-10-08 13:52:56 -07:00
Lucia Sarni
1b11d5cfaa fix(style): inconsistent background colors in code sections (#6472) 2020-10-08 12:30:14 -07:00
tobiasnitsche
d9de60b878 refactor(style): add !default to Base colors in scss (#6215) 2020-10-07 17:18:48 -07:00
Mahtis Michel
f4bdf2f953 fix: multipart array sample generation for items (#6461)
* 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
2020-10-07 16:59:29 -07:00