docusaurus-plugin-openapi-docs 0.0.0-479 → 0.0.0-480
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.
|
@@ -60,12 +60,10 @@ function sampleResponseFromProp(name, prop, obj) {
|
|
|
60
60
|
}
|
|
61
61
|
const sampleResponseFromSchema = (schema = {}) => {
|
|
62
62
|
try {
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
63
|
let { type, example, allOf, oneOf, anyOf, properties, items } = schema;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// }
|
|
64
|
+
if (example !== undefined) {
|
|
65
|
+
return example;
|
|
66
|
+
}
|
|
69
67
|
if (allOf) {
|
|
70
68
|
const { mergedSchemas } = (0, createResponseSchema_1.mergeAllOf)(allOf);
|
|
71
69
|
if (mergedSchemas.properties) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-480",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "6d77512149a4c61b12d98b152a6a8f36446c9b3c"
|
|
72
72
|
}
|
|
@@ -77,13 +77,11 @@ function sampleResponseFromProp(name: string, prop: any, obj: any): any {
|
|
|
77
77
|
|
|
78
78
|
export const sampleResponseFromSchema = (schema: SchemaObject = {}): any => {
|
|
79
79
|
try {
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81
80
|
let { type, example, allOf, oneOf, anyOf, properties, items } = schema;
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// }
|
|
82
|
+
if (example !== undefined) {
|
|
83
|
+
return example;
|
|
84
|
+
}
|
|
87
85
|
|
|
88
86
|
if (allOf) {
|
|
89
87
|
const { mergedSchemas }: { mergedSchemas: SchemaObject } =
|