Commit Graph

1947 Commits

Author SHA1 Message Date
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
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
David Goss
cfede146ff fix(style): make paths try to stay on single line in opblock (#6243) 2020-07-29 13:30:20 -07:00
Helen Kosova
4cbae095fc fix(try-it-out): Better tooltips for min/max validations (#6266) 2020-07-28 17:10:40 -07:00
Helen Kosova
bd9117da8e fix: Replace an inline styleswith propClass (#6265) 2020-07-28 16:58:57 -07:00
Tim Lai
14278e83dc fix: use es2015 modules for react-syntax-highlighter (#6246) 2020-07-28 16:35:53 -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
eacc7b92d1 Revert "revert: feat: Allow to skip submitting empty values in form data (#5830)" (#6227)
This reverts commit 1b6cb7d1bf.
2020-07-15 16:07:32 -07:00
Vladimir Gorej
1b6cb7d1bf revert: feat: Allow to skip submitting empty values in form data (#5830)
This reverts commit b9b32c9c93.

Refs #6203 #5830
2020-07-07 16:17:36 +02:00
Vladimir Gorej
e3b3bf03d4 build(bundle): use ES6 to import swagger-client symbols (#6208)
swagger-client in versions =3.10.9 exports it's build artifacts in multiple ways.
One artifact is exposed as ES5 compatible code with ES6 imports.
We use this fact to utilize webpack tree shaking algorithm.
This commit also updates swagger-client to v3.10.0
and decreases bundle size for around 10%.
2020-07-06 14:19:09 +02:00
Vladimir Gorej
95c3da19cc refactor(swagger-client): fix import of helpers (#6190)
Import of helpers from swagger-client worked because of the fact
that commonjs exports are basically an objects that can be destructured.
Whenever swagger-client switches to ES6 imports as primary mechanism
of webpack consuptions imports like that will fail. This change makes
sure that import mechanism is both compatible with ES6 and commonjs
import systems.

Along with that rename default import of swagger-client
to more appropriate SwaggerClient.
2020-07-04 13:50:36 +02:00
Vladimir
41e595beda feat: Display nullable for object model itself (#5660) (#5868) 2020-06-22 18:01:33 -07:00
geraldglynn
e1e4d5bf83 fix: render Common Extensions propertly in React 16 (#5930)
Avoid mapping Immutable.Map as React children.

Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>

Ref https://github.com/immutable-js/immutable-js/issues/667
2020-06-22 18:08:03 +02:00
geraldglynn
93020e2803 fix: avoid mapping Immutable.Map as React children (#6165)
Ref https://github.com/immutable-js/immutable-js/issues/667
2020-06-22 17:57:00 +02:00
Tim Lai
b86e8e96dd fix: curlify agnostic to order of header values (#6152)
Refs #6082

* use curlify flag isMultipartFormDataRequest
* curlify test updated


Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
2020-06-18 12:34:52 -07:00
Tim Lai
eeb0b7387f fix: remove clipboard inline svg from a file with SASS (#6148)
* directly load data:image/svg+xml
* current webpack config only allows inline file via jsx
2020-06-15 17:55:40 -07:00
Alex Mayants
71d4e59505 improvement: Call DomPurify.addHook only if it exists (#5428)
On server-side execution `dompurify` exports factory function instead of
a purifier instance. Because of this, server-side code that imports
SwaggerUI (e.g. via `swagger-ui-react`) fails, since `DomPurify.addHook`
does not exist.

This affects universal rendering apps which share code
between client-side and server-side.
2020-06-15 15:37:52 -07:00
David DE CARVALHO
ca1b19a31b feat: Display example value in Swagger ReadOnly documentation (#4422) 2020-06-15 15:23:28 -07:00
Aldrin Abastillas
973e1f7a9b feat: Copy response to clipboard #4300 (#5278)
* Move next to download button and match styling

Co-authored-by: Aldrin Abastillas <AAbastillas@rcanalytics.com>
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-06-15 15:08:10 -07:00
blacktemplar
f8dd4e68ec feat(model view): hide applicable readOnly and writeOnly properties (#5832) 2020-06-15 13:47:26 -07:00
geraldglynn
59bbe4ff2f Added onLoad()s and tweaker onToggle() to support ScrollTo functionality for Models (#5237) 2020-06-15 13:04:14 -07:00
Vladimir Gorej
a616cb471d fix(Markdown): render markdown in more secure way
This commit changes markdown sanitization behaviour in following way:

class, style and data-* attributes are removed by default. These attributes
open possible vulnerability vectors to attackers.

The original behavior of sanitizer (before this commit) can be enabled by *useUnsafeMarkdown* configuration option.
Use this configuration option with caution and only in cases when you know
what you're doing.
2020-06-11 21:51:15 +02:00
Gary Gale
48a0b46942 improvement: Make background SVGs consistent (#5478)
* Replace Base64 encoded SVGs with unencoded version. Replace partially URL encoded SVGs with unencoded version, removing extraneous LF character
2020-06-10 17:34:53 -07:00
tomdegoede
fc3ed30f3d improvement: Move inline styles to SCSS instead (#5578)
* fix: convert propStyle to propClass
2020-06-10 16:39:48 -07:00
Wesley Schwengle
67627d7587 Remove max-width for textarea media < 768px (#6014)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-06-10 16:20:35 -07:00
Wesley Schwengle
117dcc9b16 Disable the validation badge for those who do not want it (#5994)
* disabled on string values: "127.0.0.1", "localhost", "none"
2020-06-10 15:31:35 -07:00
John
21f51494a2 fix: support variables in auth urls (#5913) 2020-06-10 14:45:02 -07:00
Matthew Morrissette
275c8f2ccf improvement: oauth "scopes" improvements (#6037)
* improvement: oauth "scopes" init parameter

* improvement: add "select all" and "select none" to oauth scopes popup
2020-06-10 11:27:54 -07:00
Tim Lai
7a1b627d0b housekeeping: remarkable (#6073)
Refs: #6050
2020-06-03 15:04:00 -07:00
Justin Rigon
edb932b511 fix upload file when array items are type=string format=binary (#6040) 2020-06-01 17:43:26 -07:00
Ashura
1874c7b401 Fix generated curl for PUT and PATCH requests (#5960) 2020-06-01 17:26:04 -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
abcang
b9b32c9c93 feat: Allow to skip submitting empty values in form data (#5830) 2020-05-29 15:46:08 -07:00
mircohaug
eaca2f6fd8 Add empty data param to cURL if no POST request body was given (#6017)
* Add empty data param to cURL if no request body was given

Some middleware applications do not allow POST requests without a content-length header. By adding a empty data parameter to the curl command, the content-length header will be set by curl. Besides this it is more obvious to the user that no request body is sent.

* use double quotes like the rest of the curl command
2020-05-29 15:10:22 -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
3a65070bf5 fix: entries as property name (#6025) 2020-05-20 11:54:57 -07:00
Tim Lai
65597d15c7 fix: jsonSchemaComponent file/files (#5997) (#6000)
oas3 - files
oas2 - file
2020-05-13 17:12:18 -07:00
Tim Lai
96c7b4cbf5 fix: curl array support within multipart/form-data (#3838) (#5999)
ft: utils.createObjWithHashedKeys
ft: curlify.extractKey
test: curlify with array representation
2020-05-13 16:59:37 -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
Timothy Lai
0426eb2344 housekeeping: prevent log warning for missing getComponent in production
This is a force-pushed squash of two PR merges (#5919, #5940) that were
formerly present on master as individual commits.

Co-Authored-By: kyle shockey <kyleshockey@gmail.com>
2020-04-04 18:52:25 -04:00
Simran
95e72e7c70 improvement: do not require basic password in UI (#5812)
* Fix basic-auth.jsx: do not require password in UI

password is not PropTypes.string.isRequired, but the markup wrongly makes it mandatory

* Do not require password input in http-auth.jsx

This is used by the Authorize modal. Not sure when the similar code from basic-auth.jsx is used.

Co-authored-by: kyle shockey <kyle.shockey1@gmail.com>
2020-03-22 19:53:04 -04:00
Tim Lai
c30862ef42 bug: expanding model when query param showExtensions=true exists 2020-03-16 14:34:32 -07:00
Tim Lai
20d5c225c2 bug: expected PropType in Model ImmutablePureComponent should be a map instead of OrderedMap (#5921) 2020-03-16 14:02:37 -07:00
Tim Lai
10b08af5ec Fix: #5669 online validator badge (#5909)
* fix: enable online validator badge

since online validator badge now can handle OAS3 specs
2020-03-11 09:59:00 -07:00
geraldglynn
54f82df3c3 improvement: add isShownKey prop to Operation to allow overriding (#5196)
* Added optional isShownKey prop to Componenent to allow overriding

* Removed unneccasry  before is isShwonKey

* Added PropTypes to isShownKey

* Added isShownKey to <OperationWrapper/> and removed it from <Operation />

* Removed isShwonKey prop it from <Operation />

* revert package-lock.json

Co-authored-by: kyle shockey <kyleshockey@gmail.com>
2020-03-08 21:59:15 -04:00