Commit Graph

27 Commits

Author SHA1 Message Date
Mahtis Michel
8405fa0101 feat: request snippets plugin (#6910) 2021-03-10 11:02:34 -08: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
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
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
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
a1589a679c style: replace var with let in /test files (#6164) 2020-06-23 10:16:23 -07:00
Tim Lai
faae3e9d2c style: fix indent spaces from 4 to 2 in test files (#6163) 2020-06-23 09:44:24 -07:00
Vladimir
41e595beda feat: Display nullable for object model itself (#5660) (#5868) 2020-06-22 18:01:33 -07: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
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
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
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
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
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
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
Adam Jones
e98e7be4ec improvement: render OAS3 parameter type formats (#5796)
* Feature: Render OAS3 parameter type formats

* Add more test cases to parameter-row

* Update test/mocha/components/parameter-row.jsx

Co-Authored-By: Helen Kosova <hkosova@users.noreply.github.com>

* Update src/core/components/parameter-row.jsx

Co-authored-by: Helen Kosova <hkosova@users.noreply.github.com>
Co-authored-by: kyle shockey <kyleshockey@gmail.com>
2020-03-08 20:22:17 -04:00
Jamie Peabody
e8266a3c6d fix: code highlight styles are now only applied pre.microlight (#5673)
* patch(#5672): code highlight styles are now only applied to pre blocks that have the class pre.microlight

* fixed pre style appied to .request-url

* fixed response-headers and request-duration pre blocks

* made pre.microlight class as per review

* added microlight class to appropriate pre and added tests
2019-11-03 20:46:38 -05:00
kyle
75a0e5d5dc fix(validateParam): validate JSON parameter values + support Parameter.content (#5657)
* improve(getParameterSchema): ParameterSchemaDescriptor pattern

* chore: update usage of `getParameterSchema`

* consider `Parameter.content` media type when validating JSON values
2019-10-11 11:20:23 -07:00
poveilleux
139592e353 feat: add PKCE support for OAuth2 Authorization Code flows (#5361)
* Add PKCE support.

* Fix tests

* Update oauth2.md

* Rename usePkce

* Fix the BrokenComponent error

* Update oauth2.md

* Remove isCode variable. Remove uuid4 dependency.

* Remove utils functions

* Import crypto

* Fix tests

* Fix the tests

* Cleanup

* Fix code_challenge generation

* Move code challenge and verifier to utils for mocks. Update tests.

* Mock the PKCE methods in the utils file properly.

* Add missing expect

* use target-method spies

* Add comments to explain test values.

* Get rid of jsrsasign.
2019-10-07 17:24:43 -07:00
kyle
00c8e964e7 fix: accept string-represented values in required array runtime validation (#5609)
* rename `listCheck` -> `arrayListCheck`

* allow non-empty strings to quality a required array value
2019-09-15 12:17:42 -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
f523ec40f0 housekeeping: reorganize and rewire Mocha tests (#5600)
* move Mocha-run tests to `test/mocha`

* fix relative paths

* fix JSX test paths

* update stagnated JSX tests

* `test/setup.js` -> `test/mocha/setup.js`

* use regex+globstar for test matching

* remove `console.log`
2019-09-10 21:26:21 -07:00