Commit Graph

44 Commits

Author SHA1 Message Date
Oliwia Rogala
b5c84f44c7 fix(oas31): fix re-rendering of the Webhooks component (#9938)
Refs #9937
2024-05-15 13:52:41 +02:00
Oliwia Rogala
9037acf508 fix(components): add support for oneOf/anyOf JSON Schema keywords in parameter-row rendering (#9934)
Refs #7912
2024-05-14 11:54:44 +02:00
Oliwia Rogala
94f2d8298a fix(components): fix rendering for empty examples in responses (#9926)
Refs #9499
2024-05-10 13:42:33 +02:00
Oliwia Rogala
3bea389715 fix(oas3): compensate for JSON Schemas left unresolved by swagger-client (#9794)
Refs #9790
2024-04-10 08:41:49 +02:00
Vladimír Gorej
111e420c98 fix(oas31): allow override names of top level schemas (#9787)
Refs #9713

Co-authored-by: Oliwia Rogala <oliwia.rogala@smartbear.com>
2024-04-08 13:43:38 +02:00
Oliwia Rogala
ed983eb260 fix(oas3): add support for oneOf/anyOf JSON Schema keywords in request-body rendering (#9767)
Refs #9763
2024-03-29 14:08:48 +01:00
Oliwia Rogala
8086d97e76 fix(oas3): fix getting initial values for request body in OpenAPI 3.x (#9762)
Refs #9745
2024-03-29 13:36:16 +01:00
Oliwia Rogala
32e7ce43d6 fix: avoid rendering empty response schemas (#9667)
Refs #9666
Co-authored-by: Pierre Paysant-Le Roux <ppaysant@gmail.com>
2024-03-06 15:10:29 +01:00
Vladimír Gorej
e2be707d7c fix(oas31): render responses with empty content field (#9664)
Refs #9199
2024-03-06 14:20:45 +01:00
Oliwia Rogala
6154396e06 fix: fix regression in definition resolution (#9658)
Refs https://github.com/swagger-api/swagger-js/issues/3385
Refs #9645
2024-03-01 13:50:04 +01:00
Oliwia Rogala
7300e6c04e fix(oas3): attempt to render schemas not resolved by swagger-client (#9629)
Refs #9513
2024-02-23 11:30:28 +01:00
Oliwia Rogala
a88bed5130 fix(spec): render response body for non-200 responses (#9555)
Refs #9556
2024-02-07 16:05:00 +01:00
Vladimír Gorej
0144dad03d fix(callbacks): display all defined callbacks (#9223)
Refs #9222
2023-09-18 09:26:12 +02:00
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
Tim Lai
4b5d4bda96 fix(xml): render example with oneOf/anyOf (#8206)
* test(e2e): render xml example with oneOf/anyOf
2022-09-28 14:33:58 -07:00
Fabian Schneider
6ae2693d47 feat: Render external docs links and descriptions (#7559)
Co-authored-by: Tim Lai <timothy.lai@smartbear.com>
2022-08-17 10:42:36 -07:00
Andreas Deininger
9891d97201 docs: fix typos and update https references (#8154)
Co-authored-by: Tim Lai <timothy.lai@smartbear.com>
2022-08-12 10:14:27 -07:00
Tim Lai
41f84aad05 fix: set yaml parser load option to JSON_SCHEMA (#8023) 2022-05-12 15:51:38 -07:00
Tim Lai
7b06ac1b7c test(oath): for authorization bearer (#7936) 2022-03-23 14:29:02 -07:00
Tim Lai
a0e9923dd5 fix(serverVariables): refresh state on definition change (#7821)
* fix(serverVariables): refresh state on definition change

* test(serverVariables): urls with server variables assertions
2022-02-01 15:57:33 -08:00
Christian Egli
c6d8d779d0 feat: do not ask for client secret when using auth code with PKCE (#7438)
Co-authored-by: Ignacio Lozano <nacholozano@gmail.com>
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>

Refs #6290
2022-01-26 10:56:09 +01:00
Tim Lai
de3d063ca3 fix(sample-gen): parameter array missing items fallback (#7376)
* fixes #7375
2021-06-24 16:25:54 -07:00
Andreas Grub
13c110a6fe feat(oas3): Show file upload for schema binary format (#7325)
* fix(ux): display actual content type instead of hard-coded application/octet-stream

* feat(ux): show file upload when schema has "format: binary", fixes #5636

* feat(ux): show file upload when schema has "format: base64"

According to
https://github.com/swagger-api/swagger-ui/pull/7325#issuecomment-861684260
the uploaded file should be converted to base64 automatically.

* feat(ux): add cypress tests for displaying an upload button
2021-06-22 15:33:57 -07:00
Tim Lai
87ded996fa fix(sample-gen): oas3 form-data object should generate example (#7355) 2021-06-18 16:49:50 -07:00
Mahtis Michel
53829f18a6 fix: required properties (#7206)
* fix: required properties

schema required properties should not be treated like required: true.
this lead to objects that requires properties being treated as required itself

* test: try-it-out-schema-required-override-allowed

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2021-04-29 12:31:22 -07:00
Tim Lai
92f1507408 fix(syntaxHighlighter): request and response examples for json cases (#7199)
* OAS 2 request and response examples for json cases
* OAS 3 request and response examples for json cases
* OAS2 and OAS3 tests
* jsonParse utils for syntax highlighting
2021-04-20 11:39:05 -07:00
Mahtis Michel
68bd61a682 fix: multipart enum initial value not set (#7004) 2021-03-03 12:49:56 -08:00
Kyle Hoskins
265bdc07b7 feat: add tryItOutEnabled configuration (#6865)
* feat: add tryItOutEnabled configuration

allow users to set tryItOutEnabled: true to display
the "Try it out" section by default

tryItOutEnabled to take === "true" for the
query string value or === true if someone
implements query string type parsing in the query
2021-01-26 09:00:38 -08:00
Mahtis Michel
ddaee4ec42 feat: group / sort parameters by location (#6745) 2021-01-14 11:39:01 -08:00
Shelby Sanders
6a4e52aadb feat: support for showExtensions on Response objects (#6535) 2020-10-21 18:49:39 -07:00
Tim Lai
3905fadfbe fix(oas3): switching media types should update schema properties (#6518)
* When the media-type is changed, there is a new `onChangeMediaType` method to handle actions.
* If target schema properties key/value pairs does NOT equals current schema properties, clear the requestBodyValue, try-it-out request/response and validation params.
* If target schema properties key/value pairs DOES equals current schema properties, do not change or re-render schema properties
* oas3Selector `validateShallowRequired` now also validates required keys against target media-type

Fixes #6201, #6250, #6476
2020-10-14 16:24:07 -07:00
Tim Lai
f5c709f97f fix(try-it-out): required boolean default value set to empty string (#6449)
ref: #6429

* fix(try-it-out): required boolean default value set to empty string
* test(try-it-out): required enum and boolean fields
2020-09-30 15:27:41 -07:00
geraldglynn
084b236f76 fix(Models): use specPath for isShownKey to toggle models (#6200)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2020-07-31 18:40:47 -07:00
Tim Lai
22668ee8d3 fix(OAS3): servers component update on definition change (#6280)
* fix(OAS3): servers component should use nextProps

* test(OAS3): cypress tests for selecting multiple servers

* test(OAS3): multiple server test with definition change
2020-07-31 16:22:17 -07:00
Tim Lai
2fd1e4037c feat(RequestBody): validation support for required fields (#6223)
fixes #5181

* application/json
* application/xml
* application/x-www-form-urlencoded

* Set requestBodyValue values to be an immutable Map, as "value". Previously stored as a normal String.
* This enables adding "errors" to the Map, for validation use

* note: getOAS3RequiredRequestBodyContentType requires state.spec,
* which is not available to state.oas3
2020-07-16 17:53:28 -07:00
Tim Lai
b68942c043 feat(RequestBody): set default true for 'send empty value' (#6228) 2020-07-16 17:01:18 -07:00
Tim Lai
5eb23cdd48 ft: JsonSchema components are now ImmutableJS compliant (#5952)
bug: JsonSchema components should validate schema properties exists
  - schema
  - type
  - format
  - enum
bug: fix a debounce error in JsonSchema_string if value is null
ft: new simplified JsonSchemaArrayItemText component
test: use immutableJS for `json-schema-form` test
test: add dev scripts to run `cypress open`
test: new cypress `schema-form` tests
2020-05-06 13:57:58 -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
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
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
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