Commit Graph

477 Commits

Author SHA1 Message Date
Vladimir Gorej
ddedb57dc0 feat(json-schema-2020-12): add support for expandable behavior
Refs #8513
2023-04-26 13:55:45 +02:00
Vladimir Gorej
9ed1c1b3a0 feat: introduce new UI + extendable behavior
Ref #8513
2023-04-26 13:55:45 +02:00
Vladimir Gorej
ab1842083d feat(json-schema-2020-12): add initial rendering engine
Refs #8513
2023-04-26 13:55:45 +02:00
Vladimír Gorej
4dc83b900d fix(oas3): expand Callback operation without browser error (#8509)
Refs #8508
2023-03-23 15:12:17 +01:00
Vladimír Gorej
3d3fea09c6 fix(oas31): render Callback operations only (#8507)
Before this fix, other Path Item fields were
included into rendering of Operation Objects under
a specific Callback Object.

Refs #8504
2023-03-23 13:38:35 +01:00
Vladimir Gorej
7bdb605dcf docs(oas31): provide docs for createOnlyOAS31SelectorWrapper 2023-03-23 11:05:26 +01:00
Vladimír Gorej
e1816a5937 refactor(oas31): use OpenAPI 3.1 specific component wrapper util (#8503) 2023-03-23 10:55:41 +01:00
Vladimír Gorej
16224263d1 feat(oas31): add support for OpenAPI 3.1.0 badge (#8502)
Refs #8501
2023-03-23 10:13:20 +01:00
Vladimír Gorej
5c11bb5a45 fix(oas31): detect user request body edits in OpenAPI.paths (#8500)
Affected wrapped selector was hasUserEditedBody.
This commit fixes the bug by calling the original
selector when path+method combination is not found
in OpenAPI.webhooks field.

Refs #8498
2023-03-22 09:12:27 +01:00
Vladimír Gorej
25edb232f0 fix(oas31): fix recursive bug in hasUserEditedBody selector wrapper (#8499)
Refs #8498
2023-03-21 21:22:23 +01:00
Vladimír Gorej
18681857c6 feat(oas31): add support for rendering OpenAPI.jsonSchemaDialect field (#8496)
Refs #8491
2023-03-21 14:13:18 +01:00
Vladimír Gorej
4810801f77 feat(oas31): add support for OpenAPI 3.1.0 in VersionPragmaFilter (#8495)
Refs #8492
2023-03-21 11:52:07 +01:00
Vladimír Gorej
d837b2b511 refactor(oas31): disable try it out mechanism explicitly for webhooks (#8485)
Refs #8474
2023-03-20 09:44:22 +01:00
Vladimír Gorej
d7099793a4 refactor(oas31): introduce selector composition mechanism (#8484)
Refs #8474
2023-03-20 08:34:11 +01:00
Vladimír Gorej
47e12f1de3 refactor(oas31): simplify Webhooks component by utilizing selectors (#8481)
Refs #8474
2023-03-17 18:14:23 +01:00
Vladimír Gorej
865d98d6be refactor(oas31): change Info compnent to be smart (#8479)
Refs #8474
2023-03-17 10:55:49 +01:00
Vladimír Gorej
a3d3f26c42 refactor(oas31): change Contact component to be smart (#8478)
Refs #8474
2023-03-17 10:30:19 +01:00
Vladimír Gorej
91ba415632 refactor(oas31): consolidate plugin selectors (#8477)
Refs #8474
2023-03-16 17:15:27 +01:00
Vladimír Gorej
990d1f288e refactor(oas31): change License component to be smart (#8476)
Refs #8474
2023-03-16 15:54:59 +01: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
Vladimir Gorej
0d0e6d9b23 feat: integrate swagger-client@3.19.1 2023-03-08 11:08:49 +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
Mathias Spanhove
ffe24d5a83 fix(try-it-out): reset of oas3 requestBody should use default values (#8265)
Co-authored-by: Mathias Spanhove <mathias.spanhove@katoennatie.com>
2022-11-08 15:23:19 -08:00
Guillaume Tassery
b010b558f1 fix(ui): handle missing schema reference case for discriminant definitions (#8257)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-10-26 12:14:28 -07:00
kai-morich
94575666c3 fix(oauth2): only display scopes relevant for current endpoint (#8229)
* 'available authorization' popup: only show oauth2 scopes relevant for current endpoint (issue #8219)

* unit tests for oauth2 scope filter

Co-authored-by: Kai Morich <kai.morich@sap.com>
Co-authored-by: Tim Lai <timothy.lai@smartbear.com>
2022-10-24 13:37:49 -07:00
Ahmed Yarub Hani Al Nuaimi
f5bb456ffa feat(example): set discriminated properties to mapped value (#8213) 2022-10-17 16:22:43 -07:00
Dan Wallis
130a1be133 feat(try-it-out): display validation error messages (#8212) 2022-10-14 09:36:13 -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
d68b7485b1 fix(lint): upcoming eslint@8 reported errors (#8105)
* fix: duplicate propTypes

* chore(lint): fix extra semicolon
2022-07-19 14:46:43 -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
3aef3bf2bf fix: remove leftover text in request snippets (#8011) 2022-05-05 09:26:00 -07:00
Tim Lai
ffeb678f86 Revert "fix(oas3): set markdown line breaks to true (#7942)" (#7967)
This reverts commit b1128d7649.
2022-04-01 10:26:53 -07:00
Steven James
b825e44077 fix(fn): RandExp error should not cause UI to completely fail (#7940)
* regexp syntax varies across languages
2022-03-28 16:29:01 -07:00
Tim Lai
b1128d7649 fix(oas3): set markdown line breaks to true (#7942) 2022-03-24 15:47:11 -07:00
Tim Lai
9250e209d4 fix(request-snippets): prevent scrolling errors from missing function (#7941)
* fix(request-snippets): prevent scrolling errors from missing function

* refactor(request-snippets): migrate to functional component

* fix(curl): remove undefined prop and function

* test(live-response): fix import of RequestSnippets
2022-03-24 11:23:42 -07:00
Tim Lai
859b2e149a fix(auth): use aria-label instead of name field (#7930) 2022-03-22 17:17:03 -07:00
Raymond Berger
d064198c37 fix(auth): add name tag to bearer input field (#7743)
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-15 11:42:18 -07:00
Maciej Kowalski
8f63462f9e feat(oauth2): authActions.authPopup plugin accessible wrapper (#7699)
* enables win.open to be extensible by plugins

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-10 14:44:46 -08:00
dewijones92
3d79c24949 fix(examples): allow string created by regex pattern (#7829)
Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-03-03 16:31:00 -08:00
Tim Lai
07d346b516 feat(build): webpack@5 and webpack-dev-server@4 (#7826)
SwaggerUI is now built using `webpack@5`, with dev support for `webpack-dev-server@4`
- ES Module output bundle path now points to `swagger-ui-es-bundle-core`, which does not include dependencies
- No change to CommonJS output bundle or path
- Now uses Asset Modules, which replaces `file-loader`, `raw-loader`, and `url-loader`
- Removed unused rules/loaders for `.woff | .woff2 | .ttf | .eot` fonts and html
- Node polyfills are no longer bundled with `webpack@5`, and must be loaded separately and/or use `resolve.fallback`. 
As an example, SwaggerUI loads `process`, `buffer`, and `stream-browserify` as `devDependencies` in order to build development and production bundles.

SwaggerUI-React
- Now imports `swagger-ui-es-bundle-core`, and similarly outputs `swagger-ui-es-bundle-core` to its `dist` directory

Dev notes:
- Order of execution matters for the production npm build scripts. `build-stylesheets` needs to get built first, 
then cleanup of any empty artifacts, before building the various production bundles
- `Dev-helpers` now relies on `HTMLWebpackPlugin` to inject css and bundle files
2022-03-01 12:08:50 -08: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
Mahtis Michel
2b30a3478d feat(requestSnippets): handle type: string, format: binary or base64 file upload data (#7545)
* test(curlify): assert that data-binary is generated

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2022-01-31 11:34:45 -08:00
Vladimir Gorej
d638e58527 fix(view-plugin): provide resolvers for memoized functions (#7801)
Before this change, memoization happened only on first
argument provided to the functions. Now the memoization
properly handle all arguments.

Refs #7800
2022-01-27 08:46:03 +01:00
Vladimir Gorej
87ccc247e0 refactor(memoize): get rid of memoizee prod dependency (#7799)
The memoizee dependency was replaced with specialization
of lodash.memoize.

Refs #7694
2022-01-26 17:39:47 +01:00
John Bednarczyk
8ea3cfd00f fix(plugins): make swagger-js wrapActions overridable (#7753)
Co-authored-by: John Bednarczyk <john.bednarczyk@singlewire.com>
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>

Refs #7730
2022-01-26 12:47:42 +01:00
Vladimir Gorej
8b1c4a7c1a feat(error-handling): introduce unified and configurable error handling (#7761)
Refs #7778
2022-01-24 16:12:13 +01:00
Vladimir Gorej
b299be764f fix: introduce Error Boundaries to handle unexpected failures (#7671)
Two new components have been updated via plugin system: ErrorBoundary and Fallback.
These components can be overridden by user plugins.

Refs #7647
2021-11-25 13:47:22 +01:00
Vladimir Gorej
e3640739a4 fix(root-inject): handle errors in functional components properly 2021-11-03 09:49:50 +01:00
Vladimir Gorej
c31cb3079a feat: allow using functional components with hooks 2021-11-03 09:49:50 +01:00
Vladimir Gorej
1283f523e7 fix(servers): compensate when server list contains a null value
Refs https://github.com/swagger-api/swagger-editor/issues/2761
Refs https://github.com/swagger-api/swagger-editor/issues/2710
Refs #7341
2021-11-03 09:49:50 +01:00