Commit Graph

3808 Commits

Author SHA1 Message Date
kyle
9a121ea445 fix: attempt to display Blob response bodies as text (#4437)
* fix: attempt to display Blob response bodies as text

... if nothing else works.

* correctly pass `prevProps.content` to updateParsedContent

* remove debugger statement

* caniuse `Blob` && `FileReader`? yes.

Blob: https://caniuse.com/#search=Blob
FileReader: https://caniuse.com/#search=filereader
2018-04-13 16:16:54 -07:00
kyle
c55f22575a fix: make Schemes <select> a fully state-controlled input (#4436) 2018-04-13 13:52:01 -07:00
Giancarlo Klemm Camilo
2795518340 enhance: scrollable + downloadable HighlightCode (#4397)
* Auto hidding content that is longer than 600 characters long.

* Added basic downloading

Slightly broken

* Better downloading

now downloads file on button click

* Fix the angry linter

* Fix dist

* Removed collapsing, added scrolling.

* Code clean up.

* CSS fix.

* prevent HighlightCode from scrolling entire document

* center "Download" text in button

* `this.downloadJSON` -> `this.downloadText`

we're always saving as `.txt`, so JSON is a misnomer

* hide Download button behind option `downloadable` prop

* `file-saver` -> `js-file-download`
2018-04-12 18:18:49 -07:00
Chris Ormerod
2bf2167a18 docs: fix typo (#4431)
Operations is lowercase, without this fix the example doesn't work as a Copy/Paste
2018-04-12 16:53:10 -07:00
kyle
dc7d7054bf fix: provide svg assets through React app instead of relying on HTML (#4429)
* fix: provide svg assets through React app instead of relying on HTML

* fix stylistic inconsistencies in HTML assets
2018-04-10 16:05:17 -07:00
Ville Skyttä
14473dd51d fix: misc. spelling errors (#4421) 2018-04-09 15:58:52 -07:00
kyle
a0b659a96e V/3.13.3 (#4420)
* v3.13.3

* rebuild dist
2018-04-06 22:55:24 -07:00
kyle
3efdf1223e fix: add additionalQueryStringParams to auth requests (#4419)
* tests: add failing unit tests

* fix: add additionalQueryStringParams to auth requests
2018-04-06 20:00:10 -07:00
kyle
911a140e38 docs: add async interceptor documentation (#4418)
* docs: add async interceptor documentation

* Update configuration.md
2018-04-06 15:19:44 -07:00
Luka Žitnik
e2d8a4e396 Fix(auth): improper resolution of relative token urls (#4180)
* fix(auth): improper resolution of relative token urls

* revert cc58ba7 for OAS2

In OAS2, relative token URLs are resolved against the host that serves the specs.
2018-04-05 19:20:20 -07:00
David DE CARVALHO
39d34523b9 Improve enum values for Enum Type in Swagger ReadOnly documentation (#4191)
* Adding enum values for Enum Type in Swagger ReadOnly documentation

* Adding enum values for Enum Type in Swagger ReadOnly documentation (optimisation) and also adding default/example value

* Add new display enums, defaults, and examples when not in TIO mode (another way to have enums values in swagger.json)

* Fix npm test result

* review corrections

* fix: don't render parameter description if field is empty

* use cross-version schema variable to access properties

* pass className through Markdown component usage

* add per-field classNames to Markdown for easier styling + testing

* remove parameter Example field (out-of-scope for this PR)

* get default value from schema instead of top-level parameter

* tests: add e2e cases for swagger2 and oas3

* remove `swagger-petstore-enum.json`

the purpose of this file lives on in the e2e test specs folder

* add missing proptypes validation

* use `classnames` to more effectively union class names
2018-04-05 18:48:19 -07:00
kyle
d90353228a pass meta error information to JsonSchemaForm correctly (#4416)
* tests: add failing e2e tests

* fix: pass meta error information to JsonSchemaForm correctly
2018-04-05 15:30:31 -07:00
kyle
4480db0390 Use non-normalized operationId for layout management, if it is available (#4410)
* test(e2e): modify e2e hot server to peacefully coexist with dev server

* tests: add failing e2e test case

* fix: use originalOperationId for layout targeting, if available
2018-04-04 18:55:10 -07:00
kyle
2c4327bfd8 v3.13.2 (#4393)
* v3.13.2

* rebuild dist
2018-03-30 21:55:58 -07:00
kyle
fd8274b353 Filter $$ref from examples (#4392)
* fix(dev-server): don't open localhost in a browser
* tests: refactor model-example enzyme tests to be more isolated
* tests: add failing sampleFromSchema tests for $$ref keys
* tests: add additional test for user-created $$ref values
* fix: create deeplyStripKey; use it to filter $$refs out of examples
* tests: add cases for deeplyStripKey
2018-03-30 18:02:32 -07:00
Helder Sepulveda
762a32b59b fix: header access for Edge browser (#4383) 2018-03-29 16:24:46 -07:00
kyle
8189fd2473 fix: path item $ref rendering (#4381)
* WIP: trigger resolution of Path Item $ref on spec load

* fix(dev-server): don't open localhost in a browser

* preserve key order when merging specJson with specResolvedSubtrees

* remove stray `debugger`
2018-03-27 17:04:31 -07:00
Jake Reed
71d39af443 fix(docker): MAINTAINER deprecated. Use LABEL. (#4370) 2018-03-27 12:02:22 -07:00
kyle
9c8955edd4 v3.13.1 (#4367)
* fix: don't assign example if an example does not exist

fixes #4319

* v3.13.1

* rebuild dist
2018-03-24 14:20:35 -07:00
kyle
003a2e7584 fix: don't assign example if an example does not exist (#4365)
fixes #4319
2018-03-24 02:04:01 -07:00
kyle
1f9fb0e68d fix: request resolution via OperationContainer on mount (#4358) 2018-03-21 21:06:18 -07:00
kyle
14ef0cc379 v3.13.0 (#4342)
* v3.13.0

* Rebuild dist
2018-03-17 00:27:24 -07:00
kyle
08cfc77fde fix: default to empty ImmutableMap when schema is missing (#4341) 2018-03-16 22:59:46 -07:00
kyle
b8cf080e6c docs: fix broken method table (#4340) 2018-03-16 22:34:54 -07:00
kyle
245428e7cd feat: preauthorization (#4339)
* feat: swagger 2.0 preauthorization methods
* tests: add cases for oas3 preauthorization
* docs: add new preauth docs; touch up existing auth docs
* tests: add `rootInject` tests
* docs: remove unfinished sentence
2018-03-16 22:25:04 -07:00
kyle
624a81201f feat: onComplete config option (#4322)
* feat: `onComplete` config option

* tests(e2e): add case for onComplete option
2018-03-16 00:08:39 -07:00
kyle
b0be261ef8 fix: remove $$ref key from example if it exists (#4333)
* fix: remove $$ref key from example if it exists

* guard $$ref property access
2018-03-15 16:40:04 -07:00
kyle
6c5a370ef7 create InfoUrl and InfoBasePath (#4330)
* create `InfoUrl` component
* create `InfoBasePath` component
* linter fixes
2018-03-14 16:06:29 -07:00
Scott O'Hara
fb7f12551f improve: show possible reasons when url fetch fails (#4295)
* improve: show possible reasons when url fetch fails
* Only check for fail reasons if no HTTP status code
* Check for mixed content errors first
* Harmonise error messages
* Set error source to 'fetch'
* improve: hide loading validator image (#4287)
* hide missing validator image
* Render nothing if validator badge has not loaded/received errors
* Revert style changes
* Allow images with data scheme (#4305)
* Add UnitTest for image
allows image elements with https scheme
* Test images with data scheme
* Add allowedSchemesByTag
* Fix error  Strings must use doublequote  quotes
* Add empty div (#4236)
if there are properties show an empty div
* v3.12.1 (#4311)
* v3.12.1
* Rebuild dist for v3.12.1
* Use window wrapper instead of direct reference
* Add trailing period to error messages
* improve readability
2018-03-12 16:57:51 -07:00
kyle
49e0466641 v3.12.1 (#4311)
* v3.12.1

* Rebuild dist for v3.12.1
2018-03-09 20:54:22 -08:00
Helder Sepulveda
ad57f5a549 Add empty div (#4236)
if there are properties show an empty div
2018-03-08 17:46:21 -08:00
Helder Sepulveda
ebf94dfccf Allow images with data scheme (#4305)
* Add UnitTest for images

allows image elements with https scheme

* Test images with data scheme

* Add allowedSchemesByTag

* Fix error  Strings must use doublequote  quotes
2018-03-08 17:17:30 -08:00
Helder Sepulveda
6ba93ad43f improve: hide loading validator image (#4287)
* hide missing validator image

* Render nothing if validator badge has not loaded/received errors

* Revert style changes
2018-03-06 21:43:06 -08:00
kyle
54153dd929 remove docker login email param (#4283) 2018-03-02 22:22:39 -08:00
kyle
83232dc2d8 v3.12.0 (#4282)
* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options

* Don't default to empty Map when getting subtree

* fix(validateParam): check for ImList type before using count method

* Use `replaceState` to update `urls.primaryName`

This gives us the stateful URL we want, without:
(a) refreshing the page on update
(b) creating a long, useless history for the user
(c) implying that browser history is two-way bound
    to Swagger-UI (it isn't, we don't have a router)

* Add `fn.opsFilter` docs and internal API versioning note

* restrict `x-example` functionality to Swagger 2.0

* polish Authorize + Close buttons

* add tachyons; use it for padding the new Reset button

* v3.12.0

* rebuild dist
2018-03-02 21:13:00 -08:00
russell
ad43965d16 improve: add button to reset example when user modifies request body (#4185)
* Add a button to reset example when user modifys request body

* lint fixes

* Revert "lint fixes"

This reverts commit 5395005ea775832045aee9bab4aaa538cd2f73ab.

* reapply lint fixes
2018-03-02 18:46:47 -08:00
Charles Capps
861cc65cff improve: add "Close" button to OAuth dialog, rename "Done" button elsewhere (#4212)
* Rename "Done" button to "Close", and add "Close" button OAuth dialog
* move Close button to the right
2018-03-02 18:40:54 -08:00
Davide Zipeto
4900b11079 feature: read the x-example field and use them as values (#3538)
* Read the x-example field and use them as values
Allow to show the value defined in the "x-example" field when pressing try-out. The "default" value will have the precedence over the x-example

* Use `parameterWithMeta` to get parameter data in <ParameterRow>
* Prefer specPath when fetching resolved subtrees in OperationContainer
* Add test for OAS3 callback rendering
* Remove debugger statement
* Pass base resolution URL directly to Swagger-Client subtree resolver
* Remove accidental comment
* Migrate additional options
* Don't default to empty Map when getting subtree
* make "default" and "x-example" mutually exclusive
"x-example" wins when both are present
* limit "x-example" to non-body parameters
2018-03-02 18:31:08 -08:00
Pavel Stefanov
b13b05e416 improve: support for oneOf and anyOf in array sample (#4136)
* Fixed oneOf and anyOf in array example

* Added tests for sampleFromSchema for array type

* Removed return example for array item
2018-03-02 16:42:51 -08:00
kyle
feef20dd67 fix: deeplinked operation resolution (#4281)
* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options

* Don't default to empty Map when getting subtree
2018-03-02 16:26:37 -08:00
kyle
4fd7f1d099 fix: remote ref resolution regression (#4273)
* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options
2018-03-01 10:12:47 -08:00
kyle
8777d8b9ff fix: use specPath prop to resolve operations in OperationContainer (#4272)
* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement
2018-02-28 17:50:08 -08:00
kyle
22036b1fbf fix: OAS3 parameter value input bug (#4271) 2018-02-28 16:30:20 -08:00
kyle
043e491f94 dependencies: zenscroll@4.0.0 -> zenscroll@4.0.1 (#4270) 2018-02-28 13:15:30 -08:00
kyle
1fb56c6f96 fix: Try-It-Out Consumes value regression (#4265)
* Migrate behavior of `operationConsumes` selector

* Improve accuracy of resolved subtree merger

* Check for Immutable Map _before_ using `get` method
2018-02-27 18:55:59 -08:00
David Vujic
e6722d87aa improve: filter as a plugin (#4255) 2018-02-27 15:44:30 -08:00
kovyfive
6f7a4c3097 fix: blob download in internet explorer (#4256) 2018-02-27 14:13:14 -08:00
Grégoire Charvet 黑瓜
71d7c1a5ab Fix deeplinking for topbar plugin (#4181)
* Fix deeplinking for topbar plugin

* Lint & added tests for search parsing/serialization
2018-02-26 21:46:18 -08:00
kyle
e41067b4c1 v3.11.0 (#4254)
* v3.11.0

* Rebuild dist
2018-02-23 23:44:37 -08:00
Helder Sepulveda
558d054986 fix: package.json to reduce vulnerabilities (#4224)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/npm:lodash:20180130

Latest report for heldersepu/swagger-ui:
https://snyk.io/test/github/heldersepu/swagger-ui
2018-02-23 22:34:29 -08:00