Commit Graph

82 Commits

Author SHA1 Message Date
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
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
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
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
Tim Lai
24225e47bf fix(xml): example generation if an array has an example (#6634)
ref: #6627
2020-11-18 15:19:52 -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
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
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
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
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
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
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
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
a73783b73d feat: syntax highlighting of code section (#6236)
Co-authored-by: AdrieanKhisbe <adriean.khisbe@live.fr>
2020-07-17 15:29:15 -07:00
Tim Lai
2fd1e4037c feat(RequestBody): validation support for required fields (#6223)
fixes #5181

* application/json
* application/xml
* application/x-www-form-urlencoded

* Set requestBodyValue values to be an immutable Map, as "value". Previously stored as a normal String.
* This enables adding "errors" to the Map, for validation use

* note: getOAS3RequiredRequestBodyContentType requires state.spec,
* which is not available to state.oas3
2020-07-16 17:53:28 -07:00
Tim Lai
b68942c043 feat(RequestBody): set default true for 'send empty value' (#6228) 2020-07-16 17:01:18 -07:00
Tim Lai
a1589a679c style: replace var with let in /test files (#6164) 2020-06-23 10:16:23 -07:00
Vladimir
41e595beda feat: Display nullable for object model itself (#5660) (#5868) 2020-06-22 18:01:33 -07:00
Tim Lai
5bbd3e71bd fix: bugs/4641 use wait on route alias (#6048) 2020-06-01 17:14:45 -07:00
Tim Lai
a371ba1ca9 fix: bugs/4641 flaky test (#6047)
* fix: flaky bugs/4641 test

* fix: apply isFunc check for security.getIn
2020-06-01 14:23:51 -07:00
Tim Lai
68185dd71a fix: remove special handling of non-FormData entries (#6036)
Ref: #6033

* 'createObjWithHashedKeys' validation consistency with isFunction
* 'createObjWithHashedKeys' additional jsdoc example
2020-05-28 09:16:21 -07:00
Tim Lai
add5753da4 test: improve reliability of /bugs/4641 (#6013)
Ref #6001
2020-05-27 15:45:23 -07:00
Tim Lai
3a65070bf5 fix: entries as property name (#6025) 2020-05-20 11:54:57 -07:00
Tim Lai
4542806af6 bug: remove clearValidation from onTryoutClick (#5955) 2020-05-06 14:07:22 -07:00
Tim Lai
5eb23cdd48 ft: JsonSchema components are now ImmutableJS compliant (#5952)
bug: JsonSchema components should validate schema properties exists
  - schema
  - type
  - format
  - enum
bug: fix a debounce error in JsonSchema_string if value is null
ft: new simplified JsonSchemaArrayItemText component
test: use immutableJS for `json-schema-form` test
test: add dev scripts to run `cypress open`
test: new cypress `schema-form` tests
2020-05-06 13:57:58 -07:00
Simon Legg
c9d6ac4cfc improvement: clear auth information from memory when logging out (#5316)
* clears authentications when logout is clicked

* tests the headers sent in the network request

* adds test for multiple api keys

* refactors tests to extract common uses

* correct test message description

Co-authored-by: kyle shockey <kyleshockey@gmail.com>
2020-01-14 21:20:39 -05:00
kyle
5f6ec8ce1d fix: mitigate "sequential @import chaining" vulnerability (#5616)
* `test/e2e-cypress/tests/features/xss/` -> `test/e2e-cypress/tests/security`

* add tests

* filter <style> tags out of Markdown fields

* initialize OAuth inputs without applying `value` attribute
2019-09-20 13:19:08 -07:00
kyle
85f2bf3688 fix: <Select disabled> for type: string + enum schemas (#5601)
* fix: pass `disabled` through JsonSchemaForm – JsonSchema_string – Select

* migrate 5452 regression test
2019-09-10 22:08:03 -07:00
kyle
c9c3b2338e feature: support for Parameter.content (#5571)
* add `getParameterSchema` OAS helper

* use `Parameter.content.[firstKey].schema` as schema value when present

* `newValue` -> `initialValue`

* make `paramWithMeta` a const

* add trailing comma to `swagger2SchemaKeys`

* refactor `helpers` to a folder

* deprecate `src/core/utils.js` in favor of `src/core/helpers/`

* support `Parameter.content.[mediaType].schema` in validateParam

* reject `null` as an OAS3 object value

* expose Fetch errors in the browser console

* generate ParameterRow default values based on `content` values

* add tests for `getParameterSchema`

* remove debugger statement

* remove debugger statement

* don't apply `generatedSampleValue`s to parameters with `examples`

* remove extra semi

* disable JSON check in parameter runtime validation

* stringify JsonSchema_object textarea values

* add Cypress tests

* swagger-client@3.9.4
2019-08-31 16:37:43 -07:00
thierrydallacroce
0b3489b52d fix: remove .col class that causes collision with Bootstrap (via #5541)
* improvement: address Bootstrap conflict by removing our .col class (#4574)

* use `.parameters-col_description` selector in Cypress tests
2019-08-20 19:51:45 -07:00
kyle
39f8ceba55 fix: empty ModelExample rendering in a Response w/o content (via #5504)
* add failing test

* use falsy notSetValue for oas3SchemaForContentType
2019-07-29 22:15:19 -05:00
kyle
e895fb544f fix: use null as a notSetValue for examplesForMediaType (via #5503)
* fix: use null as a notSetValue for examplesForMediaType

fixes #5455

* tests!
2019-07-29 21:44:14 -05:00
kyle
a9493a27be fix: Swagger 2.0 Response.examples, again (via #5465)
* fix: Swagger 2.0 `Response.examples`

* stringify results
2019-07-13 01:01:57 -05:00
kyle
9749a47853 fix: Swagger 2.0 Response.examples (via #5464) 2019-07-13 00:25:43 -05:00
kyle
eaa1f4a8b4 bug: enum Select crashes when selecting the empty value (via #5463)
* add failing tests

* fix property access

* @babel/plugin-proposal-optional-chaining
2019-07-12 23:05:00 -05:00
kyle
9f10ab1d65 housekeeping: cypress standalone failures (via #5446)
* webpack.dist-style.config.js -> webpack-dist-style.config.js

* correctly generate stylesheets in dev server

* attempt to recover from missing StandalonePlugin in Cypress runner
2019-07-08 01:15:26 -05:00