142 Commits

Author SHA1 Message Date
Tim Lai
de3d063ca3 fix(sample-gen): parameter array missing items fallback (#7376)
* fixes #7375
2021-06-24 16:25:54 -07:00
Andreas Grub
13c110a6fe feat(oas3): Show file upload for schema binary format (#7325)
* fix(ux): display actual content type instead of hard-coded application/octet-stream

* feat(ux): show file upload when schema has "format: binary", fixes #5636

* feat(ux): show file upload when schema has "format: base64"

According to
https://github.com/swagger-api/swagger-ui/pull/7325#issuecomment-861684260
the uploaded file should be converted to base64 automatically.

* feat(ux): add cypress tests for displaying an upload button
2021-06-22 15:33:57 -07:00
Tim Lai
87ded996fa fix(sample-gen): oas3 form-data object should generate example (#7355) 2021-06-18 16:49:50 -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
Mahtis Michel
53829f18a6 fix: required properties (#7206)
* fix: required properties

schema required properties should not be treated like required: true.
this lead to objects that requires properties being treated as required itself

* test: try-it-out-schema-required-override-allowed

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2021-04-29 12:31:22 -07:00
Tim Lai
92f1507408 fix(syntaxHighlighter): request and response examples for json cases (#7199)
* OAS 2 request and response examples for json cases
* OAS 3 request and response examples for json cases
* OAS2 and OAS3 tests
* jsonParse utils for syntax highlighting
2021-04-20 11:39:05 -07:00
Mahtis Michel
032bd71e0a feat(sample-gen): infer implicit type and validation constraint types (#7117)
* this closes some dead ends of sample generation where no sample can be generated
2021-03-30 14:28:51 -07:00
Tim Lai
d17a81e16a fix(cypress): tweak to ensure an element exists before test (#7074) 2021-03-15 17:43:33 -07:00
Mahtis Michel
8405fa0101 feat: request snippets plugin (#6910) 2021-03-10 11:02:34 -08:00
Mahtis Michel
68bd61a682 fix: multipart enum initial value not set (#7004) 2021-03-03 12:49:56 -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
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