Commit Graph

647 Commits

Author SHA1 Message Date
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
Vladimir Gorej
8c79e2a375 refactor: prefix lifecycle methods with UNSAFE_
Refs #7341
2021-11-03 09:49:50 +01:00
Vladimir Gorej
cf9a3657cc chore(deps): replace @kyleshockey/* deps with originals
@kyleshockey/object-assign-deep - replaced by lodash/merge. If behavior
not be compatible well use lodash/mergeWith.

@kyleshockey/xml - by installing stream library directly, we can use origin
xml library without the fork.

Refs #7341
2021-11-03 09:49:50 +01:00
Mahtis Michel
90c8a73177 fix: rename request snippets configuration props (#7535)
Closes #7534
2021-10-08 16:19:00 +03:00
Helen Kosova
f1aab53dd6 fix(sample-gen): generate the correct number of properties (#7432)
This commit fixes correct number of additionalProperties when minProperties is used.
2021-09-15 15:54:26 +03:00
Vladimir Gorej
3248428e96 feat(js-yaml): update our main YAML parser to v4.1.0
Closes #6804
2021-08-09 16:30:40 +02: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
Tim Lai
38c6e127bf chore(deps): bump serialize-error from 2.1.0 to 8.1.0 (#7223)
* apply named imports, per v5.x breaking changes
2021-04-29 13:49:36 -07:00
Michael Zangl
5906dfae02 fix(authorization): include oauth endpoint description (#7195) 2021-04-20 16:39:11 -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
Tim Lai
2373a83fe2 feat: remove node_native option from request snippets plugin (#7181)
* snippet generator support intended for different shell options only
* will not maintain snippet generator for various languages
2021-04-14 10:55:31 -07:00
ben-smartbear
7fc2780bac fix: update snippet generator map to support React 16 (#7154) 2021-04-14 09:52:52 -07:00
Mahtis Michel
032bd71e0a feat(sample-gen): infer implicit type and validation constraint types (#7117)
* this closes some dead ends of sample generation where no sample can be generated
2021-03-30 14:28:51 -07:00
Tim Lai
4d264ae17f chore(lint): cumulative lint fixes prep for eslint@7 (#7078) 2021-03-16 10:11:35 -07:00
Mahtis Michel
84358aeb78 refactor: operations component (#7044) 2021-03-10 15:14:41 -08:00
Mahtis Michel
3ead825287 feat: sample gen should incorporate schema validation constraint (#7043)
* feat(sample-gen): handle minProperties, maxProperties

* fix(sample-gen): lift required

* feat(sample-gen): handle minimum, maximum (+ exclusive)

* feat(sample-gen): handle minLength, maxLength
2021-03-10 13:19:45 -08:00
Mahtis Michel
902241cf7e fix(sample-gen): xml attr with media-type example value (#7045) 2021-03-10 12:44:54 -08:00
Mahtis Michel
f9e54a26bf fix(sample-gen): allOf, oneOf lifting should consider properties and items (#7041) 2021-03-10 11:18:54 -08:00
Mahtis Michel
8405fa0101 feat: request snippets plugin (#6910) 2021-03-10 11:02:34 -08:00
Dan Dumont
f23a9d6924 fix(auth): support pkce when using basic auth header (#7038)
* support pkce when using basic auth header

* test(auth): useBasicAuthenticationWithAccessCodeGrant + usePkceWithAuthorizationCodeGrant
2021-03-10 10:30:20 -08:00
Mahtis Michel
68bd61a682 fix: multipart enum initial value not set (#7004) 2021-03-03 12:49:56 -08:00
Mahtis Michel
4db2edcad2 feat: verbose Failed to fetch error (#6938)
* feat: verbose Failed to fetch error

* refactor: disable console.error in src/core/plugins/spec/actions.js

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
2021-02-24 14:32:25 -08:00
Mahtis Michel
7ead9baa80 * fix(sample-gen): enum without type should be handled by sample-gen (#6912) 2021-02-11 09:58:28 -08:00
Mahtis Michel
fad81f8cb9 feat: use example gen for multiple example value retainer examples (#6920)
* fix: multiple examples with same value jumps to first example
2021-02-11 09:33:04 -08:00
Mahtis Michel
8ed6c34958 feat: sample-gen mulit and form media-type (#6874)
* application/x-www-form-urlencoded || **multipart/** initial value should rely on sample gen
2021-02-03 12:04:12 -08:00
Mahtis Michel
5b2ad68f50 fix(sample-gen): case yaml parsed example is number but string schema (#6872) 2021-01-28 09:04:15 -08:00
Mahtis Michel
e877580d54 feat(ux): enhance media-type switching experience in RequestBodyEditor (#6837)
* feat(ux): enhance media-type switching experience in RequestBodyEditor

1. When canceling the try-out mode the request body will be reset to its initial state.
2. When the user switches the media-type in the try-out mode, the experience is as follows:
   - If the user did edit the request body the body wont be touched and only media type is updated. This is to ensure that user content is NEVER accidentally overwritten with a default value.
   - If the user did not edit the request body it is safe to be replaced by the default value of the target media-type.

Multiple example needed some care in order to allow the retain example value to function properly

* fix(test): workaround cypress issue that can't be reproduced manually

* test: added new feature to ensure enhanced user editing flow

Signed-off-by: mathis-m <mathis.michel@outlook.de>
2021-01-25 11:16:07 -08:00
Mahtis Michel
a2f7917661 fix(sample-gen): should return json literal example (#6827)
* fix(sample-gen): should return json literal example

* test(sample-gen): should return json literal example
2021-01-14 10:59:35 -08:00
Mahtis Michel
59b42bb38f fix(sample-gen): should return xml literal example (#6822) 2021-01-12 19:01:44 -08:00