Commit Graph

602 Commits

Author SHA1 Message Date
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
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
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
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
Tim Lai
64ae7af565 fix(cypress): oas3-request-body-required flakineess (#6583) 2020-11-03 10:38:49 -08:00
Tim Lai
3925b0c564 fix(cypress): oas3-multiple-media-types flakiness (#6571)
refs #6570
2020-10-27 13:32:54 -07: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
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
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
Lucia Sarni
aa53ec24b8 fix(filter): avoid filtering by the strings "true/false" when enabled (#6477) 2020-10-08 13:52:56 -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
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
Tim Lai
f5c709f97f fix(try-it-out): required boolean default value set to empty string (#6449)
ref: #6429

* fix(try-it-out): required boolean default value set to empty string
* test(try-it-out): required enum and boolean fields
2020-09-30 15:27:41 -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
Adam David
cbe99c8c1a feat(curl): configuration setting to pass additional options to curl command for "Try it out" (#6288)
Allows `requestInterceptor` to add options to the curl command.
For example:

```js
requestInterceptor: function (request) {
  if (request.method === 'GET') {
    request.curlOptions = ['-g']
    request.url = request.url
      .replace('%5B', '[')
      .replace('%5D', ']')
      .replace('%2C', ',');
  }
  return request;
}
```
2020-09-22 11:14:51 -07:00
dalbrx-forcam
95fd3e71ab fix(auth): both array and Im.List scopes can be added to redirectURL (#6416) 2020-09-22 10:47:37 -07:00
Mahtis Michel
821ba887a6 fix: string samples should also be json stringified. (#6412)
fixes #6120
2020-09-21 12:16:26 -07:00
Amir Bitaraf Haghighi
96aecc8860 feat: Preserve authorization on browser refresh and close/reopen (#5939)
* Add default configuration `preserveAuthorization`

* Add localStorage to auth plugin

* Add persistAuthorization unit tests

* Refactor persistAuthorization to use wrapped actions

* Upgrade unit tests to be compatible with jest

* Add persistAuthorization documentation


Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-09-11 14:05:37 -07:00
ben-smartbear
6ad418d0ab fix: Updating select to pass in a better prop; updating test to do a better check (#6385)
fixes #6372
2020-09-10 11:06:46 -07:00
Alec Theriault
89d57fc078 fix(curlify): replace all occurrences of $ (#6354)
* replace all occurrences instead of only first occurrence
2020-09-10 10:11:11 -07:00
Tim Lai
d4eea4da1b fix: models view when object key contains deprecated:true (#6371)
fixes #6369
2020-09-09 16:43:01 -07:00
ben-smartbear
5123b47ef4 fix: Allowing servers dropdown to change when oas3Actions.setSelectedServer is called (#6358)
ref: #6351
2020-09-08 15:37:48 -07:00
Tim Lai
b927db86e3 refactor(enzyme): add url to jsdom constructor for unit test setup (#6356) 2020-09-01 15:25:04 -07:00
Tim Lai
1a27c0a8bd feat: migrate unit tests to Jest (#6353)
* config(jest): updated setup
* config(jest): update testMatch to include jsx files
* config(jest): add transformIgnorePatterns
* config(jest): update ignore files that do not work in jest yet
* config: add test:unit-jest to test script

* fix(jest): lint with eslint-plugin-jest

* refactor(jest): move unit test directory
* refactor(mocha): restore mocha tests that fail in jest

* docs(jest): update helpful scripts with test:unit-jest
2020-09-01 10:41:01 -07:00
Tim Lai
a26bb9284d chore(deps): update react-syntax-highlighter from 12.2.1 to 13.5.0 (#6312)
* fix(cypress): use less restrictive 'include.text' assertion

* includes prismjs@1.21.0 security update
2020-08-18 13:51:50 -07:00
Tim Lai
02e0515b97 fix(cypress): deep-linking tests should use cy.location (#6309) 2020-08-17 14:55:17 -07:00
Tim Lai
471c24dfcb fix(cypress): tests should fail on uncaught exception (#6308)
* also remove broken file logging

ref #6305
2020-08-17 13:58:57 -07:00
Tim Lai
2eaa6c10e4 feat(build): es2015 bundle artifact (#6291)
* es2015 bundle with dependencies via npm script build:es:bundle
* es2015 bundle without dependencies via npm script build:es:bundle
* jest dependency for test:artifact
* migrate babel.config.json to babel.config.js and maintain env support for commonjs and es2015
* remove polyfill
* fix es syntax: replace module.exports with export
* fix es syntax: remove .jsx extension inside import
2020-08-13 17:21:55 -07:00
geraldglynn
d9f5691f65 fix(OAS3): relative urls (#5341)
* Added tooling for appending OAS3 relative URLs to selected Server

Info
* Terms of service URL
* Contact URL
* License URL
* External Docs URL

Tag
* Tag External Docs URL

Operation
* Operation External Docs
** Operation Tag


Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-08-04 13:21:19 -07:00
Alec Theriault
225a915cf8 fix: escape $ in curl request bodies and headers (#6245)
This address a bug where a `$` character in a request body or header
would not be properly escaped in a string in the generated curl command.

Fixes #5390
2020-08-03 09:07:06 -07:00
geraldglynn
084b236f76 fix(Models): use specPath for isShownKey to toggle models (#6200)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-07-31 18:40:47 -07:00
Irena Shaigorodsky
d7d166d0a4 fix: specify charset utf-8 in html script declaration (#6278)
ref: #5311
2020-07-31 16:51:17 -07:00
Tim Lai
22668ee8d3 fix(OAS3): servers component update on definition change (#6280)
* fix(OAS3): servers component should use nextProps

* test(OAS3): cypress tests for selecting multiple servers

* test(OAS3): multiple server test with definition change
2020-07-31 16:22:17 -07:00
Tim Lai
abcc3837e9 fix(requestInterceptor): use async/await to support return new Promise (#6279)
ref: #4778
2020-07-31 10:07:52 -07:00
Helen Kosova
fd5a59a3fd feat: Display minProperties an maxProperties for object schemas (#6272) 2020-07-29 14:06:24 -07:00
Helen Kosova
4cbae095fc fix(try-it-out): Better tooltips for min/max validations (#6266) 2020-07-28 17:10:40 -07:00
Timothy Lai
3cafd6086e config(mocha): remove deprecated --compiler flag 2020-07-24 13:53:54 -07:00