docusaurus-plugin-openapi-docs 0.0.0-726 → 0.0.0-727

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.
@@ -88,12 +88,6 @@ function createRequestSchema({ title, body, ...rest }) {
88
88
  if (firstBody === undefined) {
89
89
  return undefined;
90
90
  }
91
- // we don't show the table if there is no properties to show
92
- if (firstBody.properties !== undefined) {
93
- if (Object.keys(firstBody.properties).length === 0) {
94
- return undefined;
95
- }
96
- }
97
91
  return (0, utils_1.create)("MimeTabs", {
98
92
  className: "openapi-tabs__mime",
99
93
  children: [
@@ -36,11 +36,6 @@ function createResponseSchema({ title, body, ...rest }) {
36
36
  responseExamples === undefined) {
37
37
  return undefined;
38
38
  }
39
- if ((firstBody === null || firstBody === void 0 ? void 0 : firstBody.properties) !== undefined) {
40
- if (Object.keys(firstBody === null || firstBody === void 0 ? void 0 : firstBody.properties).length === 0) {
41
- return undefined;
42
- }
43
- }
44
39
  return (0, utils_1.create)("TabItem", {
45
40
  label: `${mimeType}`,
46
41
  value: `${mimeType}`,
@@ -116,6 +116,16 @@ function createAnyOneOf(schema) {
116
116
  */
117
117
  function createProperties(schema) {
118
118
  const discriminator = schema.discriminator;
119
+ if (Object.keys(schema.properties).length === 0) {
120
+ return (0, utils_1.create)("SchemaItem", {
121
+ collapsible: false,
122
+ name: "",
123
+ required: false,
124
+ schemaName: "object",
125
+ qualifierMessage: undefined,
126
+ schema: {},
127
+ });
128
+ }
119
129
  return Object.entries(schema.properties).map(([key, val]) => {
120
130
  return createEdges({
121
131
  name: key,
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-726",
4
+ "version": "0.0.0-727",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -60,5 +60,5 @@
60
60
  "engines": {
61
61
  "node": ">=14"
62
62
  },
63
- "gitHead": "39c0a0f621f4595e62c79565a54ca50bc6f9908d"
63
+ "gitHead": "aecd4b5fa86c36310c4176dad9961d7fb8386edf"
64
64
  }
@@ -108,12 +108,6 @@ export function createRequestSchema({ title, body, ...rest }: Props) {
108
108
  return undefined;
109
109
  }
110
110
 
111
- // we don't show the table if there is no properties to show
112
- if (firstBody.properties !== undefined) {
113
- if (Object.keys(firstBody.properties).length === 0) {
114
- return undefined;
115
- }
116
- }
117
111
  return create("MimeTabs", {
118
112
  className: "openapi-tabs__mime",
119
113
  children: [
@@ -60,12 +60,6 @@ export function createResponseSchema({ title, body, ...rest }: Props) {
60
60
  return undefined;
61
61
  }
62
62
 
63
- if (firstBody?.properties !== undefined) {
64
- if (Object.keys(firstBody?.properties).length === 0) {
65
- return undefined;
66
- }
67
- }
68
-
69
63
  return create("TabItem", {
70
64
  label: `${mimeType}`,
71
65
  value: `${mimeType}`,
@@ -129,6 +129,16 @@ function createAnyOneOf(schema: SchemaObject): any {
129
129
  */
130
130
  function createProperties(schema: SchemaObject) {
131
131
  const discriminator = schema.discriminator;
132
+ if (Object.keys(schema.properties!).length === 0) {
133
+ return create("SchemaItem", {
134
+ collapsible: false,
135
+ name: "",
136
+ required: false,
137
+ schemaName: "object",
138
+ qualifierMessage: undefined,
139
+ schema: {},
140
+ });
141
+ }
132
142
  return Object.entries(schema.properties!).map(([key, val]) => {
133
143
  return createEdges({
134
144
  name: key,