Commit Graph

1853 Commits

Author SHA1 Message Date
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
Christoph
b2c4c4e7e7 fix: invalid Operation element IDs for multi-word tags & operationIds (via #4538)
* Transform tag name of operations to get a valid html id even with multiple words in tags

* modify operation element ID escaping logic
2018-08-22 21:55:10 -07:00
Yann Savary
12e350fcad fix: incorrect usage of lodash.lowerCase (via #4200)
* Wrong usage of https://lodash.com/docs/4.17.5#lowerCase

* Add basic tests about ResponseBody Content-Type
2018-08-22 15:15:12 -07:00
Tim Macfarlane
9a9cfdf101 improvement: omit deprecated fields in examples (via #4758) 2018-08-20 14:11:50 -07:00
kyle
708a96dcab improvement: urlencoded Request Body rendering (via #4823)
* use request body schema `required` for marking required urlencoded properties

* don't use sample schema value as a fallback

* modify property layout to mimic regular parameters

* clean up

* use default or example for iniital values
2018-08-17 18:00:06 -07:00
geraldglynn
cb2fc2089c improvement: move operation JumpToPath (via #4760) 2018-08-08 14:10:48 -07:00
Martin Danielsson
85cf0dccac improve: include more error data from authorization call (via #4801)
* Additional fix of #4048, more error messages from authorization call
  Inspect the error and error_description properties of the response, if available
* Fixed linter errors
2018-08-08 14:03:36 -07:00
kyle
87296702c6 feature: allowEmptyValue controls (#4788)
* add baseline tests

* coerce empty strings to null when updating parameter values

* add ParameterIncludeEmpty

* add redux management for empty parameter value inclusion state

* use name+in keying for state management instead of hash keying

* update new redux method usages to name+in keying

* coerce empty Immutable iterables in onChangeWrapper

* OAS3 tests & support

* add included empty parameters to requests before dispatching to Swagger Client

* make empty inclusion interface prettier

* add tests for #4587

* linter fixes

* check for truthy value before reaching into property
2018-08-04 01:26:07 -07:00
kyle
dd3afdc456 fix: anchor tag safety (via #4789)
* v3.17.6

* release(3.17.6): rebuild dist

* add failing tests

* fix Link component

* fix OnlineValidatorBadge component

* switch from <a> to <Link> in operation components

* make Markdown inputs safe

* use Link component in Info block, for target safety

* add eslint rule for unsafe `target` usage
2018-08-04 00:54:03 -07:00
kyle
fe5b2344c7 fix: default to empty object for pathItems in updateJsonSpec wrap-action (#4785)
cc #4784
2018-08-02 20:34:51 -07:00
kyle
955352251b fix(try-it-out): stringify numerical initial values in ParameterRow (#4767)
* add failing tests
* coerce initial values to string
* only convert numbers to strings when setting parameter values
2018-07-27 01:17:36 -07:00
Yuanhai He
8cde08bd83 improvement: allow viewing model when Try-It-Out is enabled (via #4723) 2018-07-26 17:47:41 -07:00
kyle
0359f9c364 housekeeping: bundle size reductions (#4713)
* set new bundlesize goal
* preserve `GeneratorFunction` instead of all function names
* use js-yaml fork that doesn't require esprima
* set HTML content directly, instead of using React-Markdown
* use remarkable for all Markdown rendering
* add babel-plugin-transform-react-remove-prop-types
* remove SplitPaneMode plugin
* remove react-collapse
* remove AST plugin, and yaml-js
* trim Markdown HTML string output before rendering
* disable obsolete function name preservation
* add `getComponent` to propTypes
2018-07-19 13:48:39 -07:00
geraldglynn
b9b4ab20af improvement: refactor Operation component structure (via #4686)
...into OperationSummary, OperationSummaryPath, OperationSummaryMethod
2018-07-17 20:37:36 -04:00
kyle
478d93ae08 Example (#4730)
* add tests for example feature
* refactor ParameterRow value setter logic
* aside: fix property access in sampleFromSchema
* prioritize media type examples for OAS3 responses
* use `example` in schema level example
* refactor: move stringify to utils
* prioritize media type examples in OAS3 request bodies
* modify nightwatch config
* fix parameter/response regressions
* reorder and broaden default value sources
* update lockfile
2018-07-14 03:09:37 -04:00
kyle
bbbd1b93cb fix: OAS3 array item value input (#4729)
* fix: OAS3 array item value input
* linter fixes
2018-07-14 02:12:00 -04:00
Yuanhai He
e70a054bd4 improvement: encode query string value for validator badge url (#4724)
* Encode query string value for validator badge url

* add tests
2018-07-13 14:44:10 -04:00
kyle
4055f51b93 fix: support multimedia media types for file upload (#4705) 2018-07-07 02:36:48 -05:00
kyle
8f65483510 fix: handle urlencoded array data correctly + don't stringify non-object sample values (#4704)
* fix: handle urlencoded array data correctly

* fix: don't stringify non-object sample values

* fix linter
2018-07-07 02:30:40 -05:00
Markus Poerschke
875caab173 improvement: prevent loading resources from third party CDN (via #4598)
Remove usage of Google Fonts to avoid any data protection issue. Using a
CDN will leak data to a third party that can be simply avoided by using
system fonts instead.

Furthermore the usage of CDNs can cause legal issues in EU countries.
2018-07-05 21:55:25 -05:00
kyle
21b0037529 improvement: handle more invalid Swagger/OpenAPI version values gracefully (#4699)
* improvement: handle more invalid version values gracefully

* use source maps in Mocha tests

yields accurate stack trace line numbers
2018-07-05 12:23:36 -05:00
yshkk
3f06bb50fb fix: exchange function name of component Try-it-out (#4687) 2018-07-04 12:53:21 -05:00
kyle
f7001f8011 housekeeping: add extraneous module linting (#4697)
preventative measure!
2018-07-04 12:36:49 -05:00
kyle
9d02a7d8ad fix(sample-gen): respect null values in examples (via #4679)
* improvement: re-enable and improve Models jump-to-path

* fix(sample-gen): respect null values in examples
2018-06-27 19:40:00 -07:00
kyle
a86fcf312a improvement: re-enable and improve Models jump-to-path (#4674) 2018-06-22 21:28:19 -07:00
Dennis Roche
b78ec5bd9d Bug/update dependencies (#4543)
* Add package-lock

* Remove karma* as no longer used. mocha is the test runner now

* Update patch and minor dev dependencies

* Update other dev dependencies, one at time

* Update webpack to v3 and fix package warnings

* Update production dependencies

* Update to react-inspector and Remove react-addons-shallow-compare as no longer used/required in 15.6

* Unused dependencies

* brace
* getbase
* matcher
* promise-worker
* react-addons-test-utils
* react-height
* redux-logger
* scroll-to-element
* shallowequal
* whatwg-fetch

* initial perf, which gets stripped out in production (#4131)

* Refactor deep-linking, in the process extracted out OperationsTag (#4349)

* add configsActions.loaded hook

* add OperationTag to hold Operations

* fix test for operations

* refactor deep-linking plugin

* [FIX] nested `url` option replacement when $API_URLS contains `url: .*,` pattern (#4601)

* fix(try-it-out): initially unset required booleans (#4613)

* fix(tio-params): disable empty values for required+enum booleans (#4615)

* feat(rendering): gate rendering based on valid version identifiers (#4614)

* create VersionPragmaFilter component

* use VersionPragmaFilter in BaseLayout

* tighten version idenitifier constraints

* handle case where user specifies a valid `swagger` and `openapi` field

* add traceable class names for each message

* add tests

* linter fixes!

* UNRELATED CHANGE: remove travis short-circuit

* add bypass switch to VersionPragmaFilter

* v3.17.0 (#4616)

* v3.17.0

* rebuild dist

* Update system.js (#4626)

Fix typo

* Revert "initial perf, which gets stripped out in production (#4131)" (#4636)

This reverts commit 5ea2150ae7.

* Update add-plugin.md (#4620)

Fixed some spacing

* fix: sample generation for nested oject schemas (#4648)

* Fix improper markdown (#4645)

escape `|`

* housekeeping: factor out components for easier BaseLayout reuse (#4604)

* improve: wrap schemes to encapsulate rendering logic
* improve: wrap filter to encapsulate rendering logic
* improve: wrap info section to encapsulate rendering logic
* improve: wrap servers plugin to encapsulate rendering logic
* improve: added tests for schemes-wrapper rendering logic
* improve: added tests for info-wrapper rendering logic, also do not render info if info is undefined
* improve: added tests for filter rendering logic
* improve: added tests for servers-wrapper rendering logic
* `InfoWrapper` -> `InfoContainer`
* add `containers` alias to Babel configuration
* `SchemesWrapper` -> `SchemesContainer`
* drop `container` from container file names
* `ServersWrapper` -> `ServersContainer`
* `Filter` -> `FilterContainer`
* follow `core/containers` pattern in BasePreset

* use HTTPS for Petstore by default (#4652)

* housekeeping: update e2e selectors (#4655)

* v3.17.1 (#4656)

* v3.17.1

* rebuild dist

* Doc updates

* Improvement: Hash-keyed Try-It-Out parameter value storage (#4670)

* allow param update by identity + hashed value storage

* add specActions.changeParamByIdentity

* add identity-based lookup support in spec selectors

* migrate `changeParam` usage to `changeParamByIdentity`

* migrate usage of `parameterWithMeta` to `parameterWithMetaByIdentity`

* update invocations of `changeParamByIdentity` to match fn signature

* use OrderedMap throughout hash-based selectors for consistency

* normalize usage of ParameterRow `onChange`

* migrate bug 4557 tests to reflect new ParameterRow interface

* remove exclusive test blocks

* linter fixes

* copy Parameters changes into OAS3 wrapper

* use rawParam for meta lookups in ParameterRow

* drop unused dependencies from `package.json`

* re-pin selenium dependency version
2018-06-21 22:42:28 -07:00
kyle
8e295c23a4 Improvement: Hash-keyed Try-It-Out parameter value storage (#4670)
* allow param update by identity + hashed value storage

* add specActions.changeParamByIdentity

* add identity-based lookup support in spec selectors

* migrate `changeParam` usage to `changeParamByIdentity`

* migrate usage of `parameterWithMeta` to `parameterWithMetaByIdentity`

* update invocations of `changeParamByIdentity` to match fn signature

* use OrderedMap throughout hash-based selectors for consistency

* normalize usage of ParameterRow `onChange`

* migrate bug 4557 tests to reflect new ParameterRow interface

* remove exclusive test blocks

* linter fixes

* copy Parameters changes into OAS3 wrapper

* use rawParam for meta lookups in ParameterRow
2018-06-21 21:36:38 -07:00
Sofiia
8416b043ea housekeeping: factor out components for easier BaseLayout reuse (#4604)
* improve: wrap schemes to encapsulate rendering logic
* improve: wrap filter to encapsulate rendering logic
* improve: wrap info section to encapsulate rendering logic
* improve: wrap servers plugin to encapsulate rendering logic
* improve: added tests for schemes-wrapper rendering logic
* improve: added tests for info-wrapper rendering logic, also do not render info if info is undefined
* improve: added tests for filter rendering logic
* improve: added tests for servers-wrapper rendering logic
* `InfoWrapper` -> `InfoContainer`
* add `containers` alias to Babel configuration
* `SchemesWrapper` -> `SchemesContainer`
* drop `container` from container file names
* `ServersWrapper` -> `ServersContainer`
* `Filter` -> `FilterContainer`
* follow `core/containers` pattern in BasePreset
2018-06-14 19:06:20 -07:00
kyle
f53f92351e fix: sample generation for nested oject schemas (#4648) 2018-06-14 16:56:03 -07:00
Kenny John Jacob
3fa3e2d89d Update add-plugin.md (#4620)
Fixed some spacing
2018-06-11 16:53:18 -07:00
kyle
a2015ee08b Revert "initial perf, which gets stripped out in production (#4131)" (#4636)
This reverts commit 5ea2150ae7.
2018-06-08 23:18:55 -07:00
kyle
a03c12786a feat(rendering): gate rendering based on valid version identifiers (#4614)
* create VersionPragmaFilter component

* use VersionPragmaFilter in BaseLayout

* tighten version idenitifier constraints

* handle case where user specifies a valid `swagger` and `openapi` field

* add traceable class names for each message

* add tests

* linter fixes!

* UNRELATED CHANGE: remove travis short-circuit

* add bypass switch to VersionPragmaFilter
2018-06-01 16:04:27 -07:00
kyle
a51bf1ea3e fix(tio-params): disable empty values for required+enum booleans (#4615) 2018-06-01 15:46:44 -07:00
kyle
690e274e07 fix(try-it-out): initially unset required booleans (#4613) 2018-06-01 13:30:42 -07:00
Josh Ponelat
90157c1a40 Refactor deep-linking, in the process extracted out OperationsTag (#4349)
* add configsActions.loaded hook

* add OperationTag to hold Operations

* fix test for operations

* refactor deep-linking plugin
2018-06-01 13:19:44 -07:00
Josh Ponelat
5ea2150ae7 initial perf, which gets stripped out in production (#4131) 2018-05-30 13:44:19 -07:00
kyle
798cc88968 linter fixes (#4595)
* v3.16.0

* rebuild dist

* rework travis early-success trigger

* Linter fixes
2018-05-26 01:14:09 -07:00
kyle
43304aa80a feat: OAS3 binary media type support (#4592)
* fix(validator-badge): resolve definition URLs against browser location

* use param as meta parameter if not found

* convert request body from Immutable if necessary

* show file upload for `format: binary` and `format: base64` jsonschema strings

* add `dispatchInitialValue` prop to JsonSchemaForm

* add optional subkey parameter to onChange

* add binary media type support to request body
2018-05-25 20:37:58 -07:00
kyle
32ab8b3ce8 fix(validator-badge): resolve definition URLs against browser location (#4580) 2018-05-21 21:03:56 -07:00
kyle
bf5acc1f40 fix(topbar): remove href from Swagger logo (#4566)
Fixes #4527.

- this `href` didn't serve any visible or known purpose
- it was added before prior to 3.0.0 and has not been modified since
  - see UX 8ab65d3b
- the `Link` was kept, since the anchor was needed to preserve the current layout.
2018-05-17 16:00:26 -07:00
kyle
c1007a287b feature: OAS3 object parameter support (#4563)
* render suitable interface for `type: object` parameters

* validate OAS3 object parameters correctly

* display parameter validation errors

* remove irrelevant css classes

* rm comment

* fix failing tests

* add validateParam tests

* add enzyme tests for object parameter rendering

* run actual tests first
2018-05-16 22:48:44 -07:00
kyle
c8480a827a fix: respect OAS3 parameter default values (#4561)
* add test cases

* refactor default setters into own function

* reach into `schema` for default value in OAS3

* remove exclusive test
2018-05-16 00:27:14 -07:00
kyle
9155eb946e fix: always display locally-available title property as a model's name (#4542)
* fix: always display locally-available `title` property as a model's name
* fix failing unit test
* add e2e test case
2018-05-10 22:15:36 -07:00
maryscar
66e9bd735a fix: model property color contrast (#4540) 2018-05-10 16:19:59 -07:00
kyle
ae849c31ea fix: remove outdated Safari check for Blob downloads (#4541) 2018-05-10 16:07:29 -07:00
kyle
75747424cf improvement: sanitization via DOMPurify (#4513)
* swap `sanitize-html` for `dompurify`

* set up node enzyme tests with jsdom

dompurify, as the name suggests, needs a DOM or it won't work!

* reconcile tests and sanitizer settings

* remove obsolete sanitizeOptions

* add `jsdom` dependency
2018-05-04 10:06:44 -07:00
Helder Sepulveda
8055129dd2 Improve downloadable HighlightCode filename (#4508)
* Update highlight-code.jsx
* improve filename no more response.txt
* use new `fileName` prop for file names
* use template strings for `fileName` prop values
* fall back to old "response.txt" file name if none is provided
2018-05-03 17:33:21 -07:00
kyle
7049de6201 v3.14.0 (#4492)
* v3.14.0

* fix: simplify config fetch interceptor implementation

* add `loadRemoteConfig` flag to requests

* v3.14.0
2018-04-27 23:20:13 -07:00
kyle
8cef3adfe6 fix: path-item $ref operation metadata storage (#4489) 2018-04-27 10:29:33 -07:00