Commit Graph

63 Commits

Author SHA1 Message Date
Vladimír Gorej
edd1153723 feat: expose plugins and presets on SwaggerUI global symbol (#9189)
Part of this commit is also:
- complete plugins consolidation
- complete presets consolidation
- build system consolidation

Refs #9188
2023-09-05 09:56:51 +02:00
Tim Lai
671e945376 test(jest): cleanup console warnings/errors (#6547) 2020-10-21 17:35:33 -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
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
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
kyle
94c86d3d50 improvement: online.swagger.io -> validator.swagger.io (#5599) 2019-09-09 21:33:23 -07:00
kyle
ad786b023f housekeeping: .js -> .jsx file extensions (via #5014)
* housekeeping: `.js` -> `.jsx` where necessary
2018-11-08 16:37:21 +00:00
kyle
004f107ec4 fix: repair schemes servers rendering (via #4913)
* create AuthorizeBtnContainer

* remove Servers and AuthorizeBtn from Schemes' concern

* add AuthorizeBtnContainer to base

* strengthen OAS3 definitionsToAuthorize

* drop obsolete tests

* linter fixes
2018-10-01 20:27:52 -05: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
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
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
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
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
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
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
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
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
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
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
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
kyle
ecf688171f feat: lazy resolver (#4249)
* default to empty `ImmutableMap` when grabbing op metadata
* pass `errors` into JsonSchema components
* Account for Immutable data structure in JavaScriptonSchema...
    ...and create empty Lists instead of Maps by default.
* Pass ImmutableList through to JsonSchema child components
* Add lazy resolving spec state extensions
* TEMPORARY: disable conventional resolved spec
* WIP
* Use resolveSubtree in Operation display
* Freebie: short-circuit Markdown component if it is given plaintext
* NEW DEFAULT BEHAVIOR: `defaultModelsExpandDepth: 1` does not expand individual models
* Render faked Model expander to trigger resolution
* Baseline support for Editor lifecycles
* Display operation summaries before the operation is resolved
* Test migrations
* WIP
* Swagger2 TIO Body params
* a bit of cleanup
* Debounce string param inputs
* Reach into unresolved operation for deprecated flag, if available
* Fire subtree request outside of render
* Remove debugging flags
* Fix logical errors in spec statePlugins
* TODOs become TODONEs!
* Migrate deeplinking feature to non-resolved spec action
* ESLint fixes
2018-02-23 01:12:53 -08:00
gilbode
f0c5f1fe33 fix: use mutated request for request URL in live-response (#4117) 2018-02-09 19:49:18 -08:00
Helder Sepulveda
f2a8ed07e0 improve(sanitizer): add more allowed attributes (#4194)
* Add a couple of items to the sanitizeOptions

*  Strings must use doublequote  quotes
2018-02-07 19:51:15 -08:00
Kyle Shockey
9bad35ed85 Refactor specPath to Im data structures to avoid waste renders 2017-12-28 18:04:12 -06:00
kyle
15dbc20efd Merge branch 'master' into master 2017-12-15 18:22:07 -08:00
Helder Sepulveda
6ba6039eb7 Merge branch 'master' into master 2017-12-12 17:48:40 -05:00
Greg Thompson
0e883d4a7a Merge remote-tracking branch 'upstream/master' into ft/deeplinking-link-component 2017-12-12 09:18:12 -06:00
kyle
a94c6c0e7f Merge branch 'master' into feature/deeplink-zenscroll 2017-12-11 19:05:16 -08:00
Greg Thompson
d2e931f3e1 DeepLink feedback 2017-12-11 14:27:28 -06:00
HelderSepu
28c706c70a Add defaultModelsExpandDepth
This change separates:
the Model (the one on the model-example section)
from
the Models (the ones at the bottom)
2017-12-08 21:12:41 -05:00
Greg Thompson
05fd5b354d update test 2017-12-08 10:20:55 -06:00
Kyle Shockey
60ee667688 Linter & test harness fixes 2017-12-07 17:07:30 -08:00
kyle
bfb4c7a8d7 Merge branch 'master' into feature/spec-path 2017-12-07 16:49:34 -08:00
Kyle Shockey
328f02c463 Move method filtering logic to Operations component 2017-12-07 14:00:47 -08:00
Kyle Shockey
eb97b91d7e Add failing tests 2017-12-07 14:00:26 -08:00
Josh Ponelat
41ae8242b6 fix test 2017-12-04 16:10:43 +02:00
Kyle Shockey
0fa532d35c Ensure that unknown types are always displayed as strings 2017-11-29 19:41:12 -06:00
Kyle Shockey
5224932cf9 Fix failing test 2017-11-29 19:21:20 -06:00
Kyle Shockey
e17a5f40f5 Add JsonSchemaForm tests, including one failing 2017-11-29 19:03:40 -06:00
Kyle Shockey
88e98ce281 fix tests 2017-11-23 12:55:29 -06:00
Greg Thompson
ee5d9a8c34 propType test fix 2017-11-09 10:23:02 -06:00
kyle
49457fe089 Correct typo in test description 2017-11-08 22:48:20 -08:00
feenr
bcad5b583e Remove commented out and debug code 2017-11-06 12:41:14 -05:00
feenr
e9d94e02d8 Add new tests for object-model 2017-11-06 10:43:43 -05:00
Josh Ponelat
e53bd3aef3 add stub to models test for specSelectors.isOAS3) 2017-11-03 17:50:46 +02:00
Mark H. Wilkinson
e1a7af4c92 Fix regression with rendering links in Markdown. 2017-10-16 14:40:07 +01:00
Owen Conti
60e8091eed Add unit test for images in markdown 2017-10-08 10:26:32 -06:00
Owen Conti
1785d48746 Remove .only from existing tests. Add markdown test cases for heading elements. 2017-10-08 10:13:09 -06:00
kyle
263f6feb2f Merge branch 'master' into ft/default_model_rendering 2017-09-29 13:29:04 -07:00