Commit Graph

40 Commits

Author SHA1 Message Date
Vladimír Gorej
8b274414ab refactor(oas31): concentrate OpenAPI 3.1.0 code to separate plugin (#8475)
Refs #8474
2023-03-16 12:05:19 +01:00
Tim Lai
4557b2497b feat: OpenAPI 3.1 support (#8367)
- New top-level field - `webhooks`. This allows describing out-of-band webhooks that are available as part of the API.

- New top-level field - `jsonSchemaDialect`. This allows defining of a default `$schema` value for Schema Objects

- The Info Object has a new `summary` field.

- The License Object now has a new `identifier` field for SPDX licenses. This `identifier` field is mutually exclusive with the `url` field. Either can be used in OpenAPI 3.1 definitions.

- Components Object now has a new entry `pathItems`, to allow for reusable Path Item Objects to be defined within a valid OpenAPI document.

- `License` and `Contact` components are now exported and available via `getComponent`

- New version predicates and selectors for `isOpenAPI30` and `isOpenAPI31`. This avoids needing to change the usage of `isOAS3` selector.

- New OAS3 components: `Webhooks`

- New OAS3 wrapped components: `Info`, `License`
2023-02-03 14:06:56 -08:00
Tomas Bruckner
0d5227bb5d feat(ux): add copy to clipboard to operation summary (#8094) 2022-07-18 10:48:57 -07:00
Vladimir Gorej
8b1c4a7c1a feat(error-handling): introduce unified and configurable error handling (#7761)
Refs #7778
2022-01-24 16:12:13 +01:00
Mahtis Michel
8405fa0101 feat: request snippets plugin (#6910) 2021-03-10 11:02:34 -08:00
Shelby Sanders
6a4e52aadb feat: support for showExtensions on Response objects (#6535) 2020-10-21 18:49:39 -07:00
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
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
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
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
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
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
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
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
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
6c5a370ef7 create InfoUrl and InfoBasePath (#4330)
* create `InfoUrl` component
* create `InfoBasePath` component
* linter fixes
2018-03-14 16:06:29 -07:00
David Vujic
e6722d87aa improve: filter as a plugin (#4255) 2018-02-27 15:44:30 -08:00
Kyle Shockey
022b660b8c Merge branch 'master' into support/editor-validation-refactor 2017-12-19 23:29:59 -06:00
Kyle Shockey
85c83931c4 Move configs plugin to core 2017-12-14 20:17:31 -08:00
Greg Thompson
d2e931f3e1 DeepLink feedback 2017-12-11 14:27:28 -06:00
Greg Thompson
0b8cd7e32f add presentational component to allow for wrapping deeplinking links 2017-12-01 14:30:37 -06:00
Greg Thompson
8ff2d77398 Merge branch 'master' into ft/3052-extensions 2017-11-20 09:48:33 -06:00
Kyle Shockey
054961bfc7 Merge branch 'ft/performance' into bug/3904-operation-not-updating 2017-11-16 18:55:17 -08:00
Greg Thompson
fc3ac17710 imports 2017-11-06 09:18:16 -06:00
kyle
09b37428c2 Merge branch 'master' into ft/property-component 2017-11-02 17:51:59 -07:00
Greg Thompson
0c41155100 adds new property display component 2017-11-02 15:19:38 -05:00
Josh Ponelat
50b318c5d9 Create a configs plugin
This starts to migrate configs to state
2017-10-25 09:59:54 +02:00
Owen Conti
b15942dfe1 Merge branch 'ft/performance' of github.com:swagger-api/swagger-ui into ft/performance
# Conflicts:
#	src/core/components/responses.jsx
2017-10-22 12:55:51 -06:00
Kyle Shockey
c9674a1fc5 Refactor Auths component flow; create component that supports HTTP auths 2017-10-18 21:23:28 -07:00
Owen Conti
d4d66b80ca Add OperationContainer component 2017-08-20 07:55:54 -06:00
Kyle Shockey
f7018bc78f Merge branch 'master' of github.com:swagger-api/swagger-ui into ft/oas3 2017-07-28 19:13:24 -07:00
Kyle Shockey
617cf7c867 Update URL fragment when operations & tags are shown or hidden 2017-07-13 23:24:19 -07:00
Owen Conti
d27cae0085 Work on #3102. Moved all the components out of model.jsx into their own files so they can be grabbed via getComponent() 2017-06-28 22:07:07 -06:00
Kyle Shockey
a2eed69ee7 Create providers directory; Markdown provider 2017-06-01 21:37:00 -07:00
Kyle Shockey
a0fbcc5dde Add OAS3 indicator 2017-05-31 18:47:51 -07:00
Kyle Shockey
3b62a93bb6 Create providers directory; Markdown provider 2017-05-18 17:05:49 -07:00
Kyle Shockey
cf80839d11 Add BaseLayout to core 2017-04-14 18:38:59 -07:00
Ron
f22a628934 in with the new 2017-03-17 21:17:53 -07:00