Commit Graph

144 Commits

Author SHA1 Message Date
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
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
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
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
Ron
bd8344c808 out with the old 2017-03-17 20:34:15 -07:00
Anna Bodnia
256583bdb5 tests #1186 Render primitive types in "Response Class" 2016-02-22 19:00:33 +02:00
Anna Bodnia
918958aa70 #1931 Fixed Need fix typo 'xlmns' 2016-01-29 18:44:01 +02:00
Anna Bodnia
db328351b9 #1892 fixed multiple definition loops 2016-01-22 20:24:45 +02:00
Anna Bodnia
9a5925f921 #1892 infinite loop when rendering self-references 2016-01-21 18:36:00 +02:00
Tony Tam
d3686c9dbd rebuilt 2016-01-20 08:57:44 -05:00
Anna Bodnia
78a09ea16f #1248 Returns single item in XML when passing array specification 2016-01-20 11:17:43 +02:00
Tony Tam
3aaf121310 added ignore on mock 2016-01-19 22:40:38 -05:00
Tony Tam
7f7f8e73bc updated quotes 2016-01-19 22:23:12 -05:00
Anna Bodnia
8a4c6560f5 #1248 implemented display property as attribute 2016-01-18 19:53:53 +02:00
Anna Bodnia
f68420051f #1248 createXMLSample Added handling readyOnly params 2016-01-18 13:50:21 +02:00
Anna Bodnia
4443883546 #1248 createXMLSample added error message 2016-01-15 12:35:11 +02:00
Anna Bodnia
9543ea4671 #1248 createXMLSample moved creating primitive xml into separate function 2016-01-14 19:16:10 +02:00
Anna Bodnia
1c555c00b8 #1248 createXMLSample added XML display for Model in definitions 2016-01-14 17:41:50 +02:00
Anna Bodnia
8917a9bf76 #1248 createXMLSample added object xml representation 2016-01-13 17:13:42 +02:00
Anna Bodnia
455c82c13b #1248 createXMLSample added tests for nested arrays 2016-01-13 12:53:32 +02:00
Anna Bodnia
aa86bb5fe7 #1248 createXMLSample added array 2016-01-13 12:30:12 +02:00
Anna Bodnia
b3ddef2965 #1248 createXMLSample added namespace display 2016-01-12 19:33:00 +02:00
Anna Bodnia
4b0b385102 #1248 createXMLSample made separate function for tagname 2016-01-12 17:14:43 +02:00
Anna Bodnia
b104272ae9 #1248 createXMLSample added getSampleDate method 2016-01-12 15:40:55 +02:00
Anna Bodnia
73feed4ca2 #1248 createXMLSample handle prefix and names in xml 2016-01-12 15:26:59 +02:00
Anna Bodnia
7a8f7016c2 #1248 createXMLSample create xml sample for primitive 2016-01-12 14:06:54 +02:00
Anna Bodnia
901305faa4 Added unit tests setup 2016-01-11 16:53:39 +02:00