redoc 2.0.0-rc.50 → 2.0.0-rc.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/bundles/9bcbfb5fe4bb244b68d4.worker.js.LICENSE.txt +68 -0
- package/bundles/9bcbfb5fe4bb244b68d4.worker.js.map +1 -0
- package/bundles/cf2d816ec177c47e23d0.worker.js.LICENSE.txt +68 -0
- package/bundles/cf2d816ec177c47e23d0.worker.js.map +1 -0
- package/bundles/redoc.lib.js +2 -14837
- package/bundles/redoc.lib.js.LICENSE.txt +6 -0
- package/bundles/redoc.lib.js.map +1 -1
- package/bundles/redoc.standalone.js +2 -102
- package/bundles/redoc.standalone.js.LICENSE.txt +106 -0
- package/bundles/redoc.standalone.js.map +1 -1
- package/package.json +92 -79
- package/typings/common-elements/fields.d.ts +0 -1
- package/typings/common-elements/linkify.d.ts +3 -7
- package/typings/components/Fields/EnumValues.d.ts +1 -1
- package/typings/components/RedocStandalone.d.ts +2 -11
- package/typings/components/RequestSamples/CodeSample.d.ts +22 -0
- package/typings/components/SideMenu/styled.elements.d.ts +1 -1
- package/typings/components/StoreBuilder.d.ts +6 -18
- package/typings/index.d.ts +3 -2
- package/typings/services/Labels.d.ts +1 -1
- package/typings/services/MenuBuilder.d.ts +1 -1
- package/typings/services/OpenAPIParser.d.ts +3 -2
- package/typings/services/models/ApiInfo.d.ts +1 -0
- package/typings/services/models/Field.d.ts +1 -0
- package/typings/services/models/Operation.d.ts +1 -1
- package/typings/services/models/Schema.d.ts +2 -1
- package/typings/services/models/Webhook.d.ts +1 -0
- package/typings/styled-components.d.ts +3 -3
- package/typings/types/index.d.ts +1 -2
- package/typings/types/index.ts +3 -0
- package/typings/types/open-api.d.ts +230 -218
- package/typings/types/open-api.ts +280 -0
- package/typings/utils/media-css.d.ts +6 -0
- package/typings/utils/openapi.d.ts +4 -3
- package/CHANGELOG.md +0 -1822
- package/bundles/4e8f2919403bd6ca29d9.worker.js.map +0 -1
- package/bundles/ebb7685df73634ba651d.worker.js.map +0 -1
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- The widest OpenAPI v2.0 features support (yes, it supports even `discriminator`) <br>
|
|
27
27
|

|
|
28
28
|
- OpenAPI 3.0 support
|
|
29
|
+
- Basic OpenAPI 3.1 support
|
|
29
30
|
- Neat **interactive** documentation for nested objects <br>
|
|
30
31
|

|
|
31
32
|
- Code samples support (via vendor extension) <br>
|
|
@@ -43,7 +44,6 @@
|
|
|
43
44
|
- [x] ~~React rewrite~~
|
|
44
45
|
- [x] ~~docs pre-rendering (performance and SEO)~~
|
|
45
46
|
- [ ] ability to simple branding/styling
|
|
46
|
-
- [ ] built-in API Console
|
|
47
47
|
|
|
48
48
|
## Releases
|
|
49
49
|
**Important:** all the 2.x releases are deployed to npm and can be used via jsdeliver:
|
|
@@ -58,6 +58,7 @@ Additionally, all the 1.x releases are hosted on our GitHub Pages-based CDN **(d
|
|
|
58
58
|
## Version Guidance
|
|
59
59
|
| ReDoc Release | OpenAPI Specification |
|
|
60
60
|
|:--------------|:----------------------|
|
|
61
|
+
| 2.0.0-alpha.54| 3.1, 3.0.x, 2.0 |
|
|
61
62
|
| 2.0.0-alpha.x | 3.0, 2.0 |
|
|
62
63
|
| 1.19.x | 2.0 |
|
|
63
64
|
| 1.18.x | 2.0 |
|
|
@@ -162,7 +163,7 @@ Also you can pass options:
|
|
|
162
163
|
|
|
163
164
|
```js
|
|
164
165
|
<RedocStandalone
|
|
165
|
-
specUrl="
|
|
166
|
+
specUrl="https://api.redoc.ly/registry/rebilly/core-api/core/bundle/master/openapi.yaml"
|
|
166
167
|
options={{
|
|
167
168
|
nativeScrollbars: true,
|
|
168
169
|
theme: { colors: { primary: { main: '#dd5522' } } },
|
|
@@ -176,7 +177,7 @@ You can also specify `onLoaded` callback which will be called each time Redoc ha
|
|
|
176
177
|
|
|
177
178
|
```js
|
|
178
179
|
<RedocStandalone
|
|
179
|
-
specUrl="
|
|
180
|
+
specUrl="https://api.redoc.ly/registry/rebilly/core-api/core/bundle/master/openapi.yaml"
|
|
180
181
|
onLoaded={error => {
|
|
181
182
|
if (!error) {
|
|
182
183
|
console.log('Yay!');
|
|
@@ -236,7 +237,7 @@ You can use all of the following options with standalone version on <redoc> tag
|
|
|
236
237
|
* `hideSchemaPattern` - if set, the pattern is not shown in the schema.
|
|
237
238
|
* `hideSingleRequestSampleTab` - do not show the request sample tab for requests with only one sample.
|
|
238
239
|
* `expandSingleSchemaField` - automatically expand single field in a schema
|
|
239
|
-
* `jsonSampleExpandLevel` - set the default expand level for JSON payload samples (responses and request body). Special value
|
|
240
|
+
* `jsonSampleExpandLevel` - set the default expand level for JSON payload samples (responses and request body). Special value `"all"` expands all levels. The default value is `2`.
|
|
240
241
|
* `hideSchemaTitles` - do not display schema `title` next to to the type
|
|
241
242
|
* `simpleOneOfTypeLabel` - show only unique oneOf types in the label without titles
|
|
242
243
|
* `lazyRendering` - _Not implemented yet_ ~~if set, enables lazy rendering mode in ReDoc. This mode is useful for APIs with big number of operations (e.g. > 50). In this mode ReDoc shows initial screen ASAP and then renders the rest operations asynchronously while showing progress bar on the top. Check out the [demo](\\redocly.github.io/redoc) for the example.~~
|
|
@@ -253,7 +254,6 @@ You can use all of the following options with standalone version on <redoc> tag
|
|
|
253
254
|
* **function**: A getter function. Must return a number representing the offset (in pixels).
|
|
254
255
|
* `showExtensions` - show vendor extensions ("x-" fields). Extensions used by ReDoc are ignored. Can be boolean or an array of `string` with names of extensions to display.
|
|
255
256
|
* `sortPropsAlphabetically` - sort properties alphabetically.
|
|
256
|
-
* `suppressWarnings` - if set, warnings are not rendered at the top of documentation (they still are logged to the console).
|
|
257
257
|
* `payloadSampleIdx` - if set, payload sample will be inserted at this index or last. Indexes start from 0.
|
|
258
258
|
* `theme` - ReDoc theme. For details check [theme docs](#redoc-theme-object).
|
|
259
259
|
* `untrustedSpec` - if set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS. **Disabled by default** for performance reasons. **Enable this option if you work with untrusted user data!**
|
|
@@ -324,7 +324,7 @@ Redoc.init(specOrSpecUrl, options, element, callback?)
|
|
|
324
324
|
- `specOrSpecUrl` is either JSON object with specification or an URL to the spec in `JSON` or `YAML` format
|
|
325
325
|
- `options` [options object](#redoc-options-object)
|
|
326
326
|
- `element` DOM element to put ReDoc into
|
|
327
|
-
- `callback` (optional) - callback to be called after Redoc has been fully rendered. It is also called
|
|
327
|
+
- `callback` (optional) - callback to be called after Redoc has been fully rendered. It is also called on errors with error as the first argument
|
|
328
328
|
|
|
329
329
|
```js
|
|
330
330
|
Redoc.init('http://petstore.swagger.io/v2/swagger.json', {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ReDoc - OpenAPI/Swagger-generated API Reference Documentation
|
|
3
|
+
* -------------------------------------------------------------
|
|
4
|
+
* Version: "2.0.0-rc.54"
|
|
5
|
+
* Repo: https://github.com/Redocly/redoc
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*!
|
|
9
|
+
* lunr.Builder
|
|
10
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*!
|
|
14
|
+
* lunr.Index
|
|
15
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/*!
|
|
19
|
+
* lunr.Pipeline
|
|
20
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/*!
|
|
24
|
+
* lunr.Set
|
|
25
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/*!
|
|
29
|
+
* lunr.TokenSet
|
|
30
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*!
|
|
34
|
+
* lunr.Vector
|
|
35
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/*!
|
|
39
|
+
* lunr.stemmer
|
|
40
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
41
|
+
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/*!
|
|
45
|
+
* lunr.stopWordFilter
|
|
46
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/*!
|
|
50
|
+
* lunr.tokenizer
|
|
51
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/*!
|
|
55
|
+
* lunr.trimmer
|
|
56
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/*!
|
|
60
|
+
* lunr.utils
|
|
61
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
|
|
66
|
+
* Copyright (C) 2020 Oliver Nightingale
|
|
67
|
+
* @license MIT
|
|
68
|
+
*/
|