docusaurus-plugin-openapi-docs 1.2.1 → 1.2.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Palo Alto Networks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -117,6 +117,11 @@ function createResponseExamples(responseExamples, mimeType) {
117
117
  label: `${finalFormattedName}`,
118
118
  value: `${finalFormattedName}`,
119
119
  children: [
120
+ (0, utils_2.guard)(exampleValue.summary, (summary) => [
121
+ (0, utils_1.create)("p", {
122
+ children: ` ${summary}`,
123
+ }),
124
+ ]),
120
125
  (0, utils_1.create)("ResponseSamples", {
121
126
  responseExample: JSON.stringify(exampleValue.value, null, 2),
122
127
  language: language,
@@ -128,6 +133,11 @@ function createResponseExamples(responseExamples, mimeType) {
128
133
  label: `${finalFormattedName}`,
129
134
  value: `${finalFormattedName}`,
130
135
  children: [
136
+ (0, utils_2.guard)(exampleValue.summary, (summary) => [
137
+ (0, utils_1.create)("p", {
138
+ children: ` ${summary}`,
139
+ }),
140
+ ]),
131
141
  (0, utils_1.create)("ResponseSamples", {
132
142
  responseExample: exampleValue.value,
133
143
  language: language,
@@ -150,6 +160,11 @@ function createResponseExample(responseExample, mimeType) {
150
160
  label: `Example`,
151
161
  value: `Example`,
152
162
  children: [
163
+ (0, utils_2.guard)(responseExample.summary, (summary) => [
164
+ (0, utils_1.create)("p", {
165
+ children: ` ${summary}`,
166
+ }),
167
+ ]),
153
168
  (0, utils_1.create)("ResponseSamples", {
154
169
  responseExample: JSON.stringify(responseExample, null, 2),
155
170
  language: language,
@@ -161,6 +176,11 @@ function createResponseExample(responseExample, mimeType) {
161
176
  label: `Example`,
162
177
  value: `Example`,
163
178
  children: [
179
+ (0, utils_2.guard)(responseExample.summary, (summary) => [
180
+ (0, utils_1.create)("p", {
181
+ children: ` ${summary}`,
182
+ }),
183
+ ]),
164
184
  (0, utils_1.create)("ResponseSamples", {
165
185
  responseExample: responseExample,
166
186
  language: language,
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": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -67,5 +67,6 @@
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=14"
70
- }
70
+ },
71
+ "gitHead": "cfeb5216f143133a1c35587fef21f75a44b75854"
71
72
  }
@@ -129,6 +129,11 @@ export function createResponseExamples(
129
129
  label: `${finalFormattedName}`,
130
130
  value: `${finalFormattedName}`,
131
131
  children: [
132
+ guard(exampleValue.summary, (summary) => [
133
+ create("p", {
134
+ children: ` ${summary}`,
135
+ }),
136
+ ]),
132
137
  create("ResponseSamples", {
133
138
  responseExample: JSON.stringify(exampleValue.value, null, 2),
134
139
  language: language,
@@ -140,6 +145,11 @@ export function createResponseExamples(
140
145
  label: `${finalFormattedName}`,
141
146
  value: `${finalFormattedName}`,
142
147
  children: [
148
+ guard(exampleValue.summary, (summary) => [
149
+ create("p", {
150
+ children: ` ${summary}`,
151
+ }),
152
+ ]),
143
153
  create("ResponseSamples", {
144
154
  responseExample: exampleValue.value,
145
155
  language: language,
@@ -163,6 +173,11 @@ export function createResponseExample(responseExample: any, mimeType: string) {
163
173
  label: `Example`,
164
174
  value: `Example`,
165
175
  children: [
176
+ guard(responseExample.summary, (summary) => [
177
+ create("p", {
178
+ children: ` ${summary}`,
179
+ }),
180
+ ]),
166
181
  create("ResponseSamples", {
167
182
  responseExample: JSON.stringify(responseExample, null, 2),
168
183
  language: language,
@@ -174,6 +189,11 @@ export function createResponseExample(responseExample: any, mimeType: string) {
174
189
  label: `Example`,
175
190
  value: `Example`,
176
191
  children: [
192
+ guard(responseExample.summary, (summary) => [
193
+ create("p", {
194
+ children: ` ${summary}`,
195
+ }),
196
+ ]),
177
197
  create("ResponseSamples", {
178
198
  responseExample: responseExample,
179
199
  language: language,