142 Commits

Author SHA1 Message Date
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
kyle
21bb452cb7 housekeeping: address inconsistently truncated JS asset responses within Cypress tests (via #5445)
* add Cypress error trace

* Update package.json

* Update webpack-hot-dev-server.config.js

* Update index.js

* Update index.js
2019-07-08 00:19:40 -05:00
kyle
23d7260f92 feat: Multiple Examples for OpenAPI 3 Parameters, Request Bodies, and Responses (via #5427)
* add opt-in Prettier config

* remove legacy `examples` implementation

* create ExamplesSelect

* support `Response.examples` in OpenAPI 3

* create response controls group

* prettier reformat

* prepare to break up Parameters

* reunify Parameters and OAS3 Parameters

* Parameter Examples

* Example component

* handle parameter value stringification correctly

* FOR REVIEW: add prop for controlling Select

* use regular header for param examples in Try-It-Out

* manage active examples member via Redux

* Request Body Try-It-Out examples

* remove special Response description styling

* omit Example value display in Try-It-Out

* support disabled text inputs in JsonSchemaForm

* Example.omitValue => Example.showValue

* ExamplesSelectValueRetainer

* styling for disabled inputs

* remove console.log

* support "Modified Values" in ExamplesSelect

* remove Examples component
(wasn't used anywhere)

* use ParameterRow.getParamKey for active examples member keying

* split-rendering of examples in ParameterRow

* send disabled prop to JsonSchemaForm

* use content type to key request body active examples members

* remove debugger

* rewire RequestBodyEditor to be a controlled component

REVIEW: does this have perf implications?

* trigger synthetic onSelect events in ExamplesSelect

* prettier updates

* remove outdated Examples usage in RequestBody

* don't handle examples changes in ESVR

* make RequestBodyEditor semi-controlled

* don't default to an empty Map for request bodies

* add namespaceKey to ESVR for state mgmt

* don't key RequestBody activeExampleKeys on media type

* tweak ESVR isModifiedValueSelected calculation

* add trace class to ExamplesSelect

* remove usage of ESVR.currentNamespace

* reset to first example if currentExampleKey is invalid

* add default values to RequestBody rendering

* stringify things in ESVR

* avoid null select value (silences React warning)

* detect user inputs that match any examples member's value

* add trace class for json-schema-array

* shallowly convert namespace state, to preserve Immutable stucts in state

* stringify RBE values; don't trim JSON in editor

* match user input to an example when non-primitives are expressed in state as strings

* update Cypress

* don't apply sample values in JsonSchema_Object

* support disabling all JsonSchemaForm subcomponents

* Core tests

* style changes to accomodate Examples

* fix version-checking error in Response

* disable SCU for Responses

* don't stringify Select values

* ModelExample: default to Model tab if no example is available; provide a default no example message

* don't trim JSON ParamBody inputs

* read directly from 2.0 Response.schema instead of inferring a value

* show current Example information in RequestBody

* show label for Examples dropdown by default

* rework Response content ordering

* style disabled textareas like other read-only blocks

* meta: fix sourcemaps

* refactor ESVR setNameForNamespace

* protect second half of ternary expession

* cypress: `select.examples-select` => `.examples-select > select`

* clarify ModelExample.componentWillReceiveProps

* add gates/defaults to prevent issues in very bare-boned documents

* fix test block organization problem

* simplify RequestBodyEditor interface

* linter fixes

* prettier updates

* use plugin system for new components

* move ME Cypress helpers to other file
2019-06-29 19:52:51 +01:00
kyle
ff496fa5bd fix: type safety for operation summary handling (via #5191)
* fix: gracefully handle non-string operation summaries

* use lodash for more summary type safety
2019-02-23 17:00:29 -08:00
kyle
1e184e8e21 fix: sanitize URLs used for OAuth auth flow (via #5190)
* fix: sanitize URLs used for OAuth auth flow

* embetter test case

* fix linter issue
2019-02-23 14:14:30 -08:00
kyle
d9f460f4a8 fix: gracefully handle non-string operation summaries (via #5189) 2019-02-19 15:41:16 -08:00
kyle
291e2c7251 improvement: operation path + summary overflow styling (via #5184)
* improvement: operation path + summary overflow styling

* inject zero-width spaces for better path breaking

* migrate 4867 regression test to tolerate new ZWSPs

* rm `dev-helpers/doc.yaml`
2019-02-15 20:05:26 -06:00
kyle
373da3bee3 fix: provide JSON editor for x-www-form-urlencoded bodies lacking properties (via #5180) 2019-02-13 18:47:01 -06:00
kyle
d3c2e2777f fix: coerce multipart initial property values to string (via #5166)
* coerce multipart initial property values to string

* add tests
2019-02-07 15:35:22 -06:00
kyle
15cdfe14dd improvement: generate non-smart Markdown quotes (via #5162) 2019-02-06 21:48:52 -06:00
kyle
0047ce96a8 fix: don't trigger url remote document load if urls is provided (via #5161)
* fix: don't trigger `url` remote document load if `urls` is provided

* better test block title
2019-02-06 19:32:35 -06:00
kyle
abf34961e9 bug: parameter allowEmptyValue + required interactions (via #5142)
* add failing tests
* standardize parameter keying
* validateParam test migrations
* migrate test cases to new pattern
* disambiguate name/in ordering in `body.body` test cases
* `name+in`=> `{in}.{name}`
* consider allowEmptyValue parameter inclusion in runtime validation
* use config object for all validateParam options
* drop isXml flag from validateParams
2019-01-29 16:46:03 -06:00
kyle
1e8e0dba30 fix: tag-level deep link escaping inconsistencies (via #5117)
* add test cases

* update tag deeplinking implementation

* MOAR test updates

* update operation-tag.jsx
2019-01-10 15:58:37 -06:00
kyle
655ef9e662 fix: urls.primaryName functionality regression (via #5097)
* add tests

* compute index before triggering URL load

* bonus: improve urls topbar label
2018-12-21 23:51:58 -06:00
kyle
69b362aded housekeeping: change test name + comment (via #5091) 2018-12-19 20:52:28 +01:00
kyle
61b5ed79a0 improvement: generate default oauth2RedirectUrl based on page location (via #5085) 2018-12-14 19:54:53 -07:00
kyle
f5e179ac39 improvement: add Schema/Model switching to ModelExample component (via #5080) 2018-12-13 21:28:01 +01:00
kyle
a5568f9e16 improve: OAuth2 UI and test suite (via #5066)
* create `features` folder

* add base oauth2 server

* continue implementing OAuth tests

* WIP

* add password flow tests

* modify Password flow credential types

* remove query string credential type

* add test case for Authorization flow

* add specific Authorization value for Password flow test

* WIP

* fix linter issues
2018-12-07 20:54:29 +01:00
kyle
91b1becc65 fix: label models section as Schemas in OpenAPI 3 (via #5065)
* fix: label models section `Schemas` in OpenAPI 3

* Update swos-63.js
2018-12-07 20:29:35 +01:00
kyle
971c6f7536 fix: path-item $ref produces/consumes inheritance (via #5049)
* implement a selector for consumes options

* fix incorrect comment, test names

* add `consumesOptionsFor` selector

* use `consumesOptionsFor` and drop `operationConsumes`
2018-11-23 23:24:11 +01:00
kyle
3df9fad68a improve: deeplinking behavior (#4960)
* add passing tests for fragment rewriting

* add failing fragment retention tests

* fire legacy `show` actions before standard ones

* skip failing tests

* remove extra line
2018-10-19 17:33:30 -05:00
kyle
9a4dd00803 housekeeping: deduplicate deep linking test cases (via #4958)
* deduplicate deep linking test cases

* clean up tests and base cases
2018-10-18 18:52:39 -05:00
James ZHANG
1791759de5 improve(deeplink): support utf16 tags and IDs (via #4921)
* ref #3958, support utf16 fragments on the deeplink plugin
* put -> head for UTF16 operation
this is a temporary fix, eventually we will run out
of methods and need to use a new targeting strategy
* drop obsolete %20 decoder
* add full test suite for UTF16 operation
* use encodeURIComponent when setting hash
* drop obsolete test cases
2018-10-18 16:55:30 -05:00
kyle
3c3b7e0bf1 bug(deeplinking): escaping breaks whitespaces & underscored tags/ids (via #4953)
* add tests for operation lacking an operationId
* add deep linking tests for tags/operationIds with underscores
* migrate from `_` to `%20` for deeplink hash whitespace escaping
* add backwards compatibility for `_` whitespace escaping
* update util unit tests
2018-10-16 18:51:29 -05:00
kyle
ecfc23972a fix: inconsistent behavior with multiple invocations of SwaggerUI (via #4923)
* add narrow e2e tests
* add failing system unit test
* break plugin object inheritance in combinePlugins
* style: add braces to if block
* drop unused `lodash.repeat` import
* remove deep-freeze from lockfile
2018-10-04 18:00:38 -05:00
k.bigwheel
13341658f9 housekeeping: test fixture file path mistake (via #4862) 2018-09-14 22:23:25 -07:00
kyle
8fb0cfd2bb fix: tolerate callback parameter values in ParameterRow (via #4873)
* fix: tolerate callback parameter values in ParameterRow
* Update 4867.js
2018-09-12 20:56:23 -07:00
kyle
54276c95e2 fix: gracefully handle empty request bodies (via #4859) 2018-09-07 16:18:13 -07:00
kyle
eb6c43405f fix: resolved model data invalidation (via #4858) 2018-09-07 14:13:43 -07:00
kyle
e6b7167dd8 fix(deeplinking): expand containing tag when expanding an operation (#4837)
* fix(deeplinking): expand containing tag when expanding an operation
* linter fixes
* tighten up test cases
2018-08-27 22:58:00 -07:00
kyle
00432fc07c fix: deep link fragment escaping (via #4832)
* `test/e2e` -> `test/e2e-selenium`

* add Cypress

* ESLint fixes

* MOAR cypress

* `integration` -> `tests`

* wire Cypress up to a hot e2e server

* add failing tests for #4537

* add petstore for future use

* don't tack `operations/` onto href path

* escape generated URL fragments

* Update package.json
2018-08-23 15:24:32 -07:00
kyle
b4f1886306 meta: supplemental tests for #4537 (via #4828)
* `test/e2e` -> `test/e2e-selenium`

* add Cypress

* ESLint fixes

* MOAR cypress

* `integration` -> `tests`

* wire Cypress up to a hot e2e server

* add failing tests for #4537

* Update package.json
2018-08-23 15:18:13 -07:00
kyle
1b2fbda646 meta: introduce Cypress end-to-end testing (via #4827)
* `test/e2e` -> `test/e2e-selenium`

* add Cypress

* ESLint fixes

* MOAR cypress

* `integration` -> `tests`

* wire Cypress up to a hot e2e server

* linter fixes

* don't run in CI
2018-08-23 15:10:00 -07:00