openapi-jsonrpc-jsdoc 1.2.2 → 1.2.3
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/index.js +15 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -154,8 +154,16 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
|
|
|
154
154
|
if (parameter.type.names[0] === 'object') {
|
|
155
155
|
return accumulator;
|
|
156
156
|
}
|
|
157
|
-
let
|
|
157
|
+
let type;
|
|
158
|
+
if (parameter.type.names.length === 0) {
|
|
159
|
+
type = 'null';
|
|
160
|
+
} else if (parameter.type.names.length === 1) {
|
|
161
|
+
type = parameter.type.names[0];
|
|
162
|
+
} else {
|
|
163
|
+
type = 'enum';
|
|
164
|
+
}
|
|
158
165
|
let items;
|
|
166
|
+
let enumData;
|
|
159
167
|
switch (type) {
|
|
160
168
|
case 'Array.<string>': {
|
|
161
169
|
type = 'array';
|
|
@@ -167,6 +175,11 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
|
|
|
167
175
|
items = { type: 'string' };
|
|
168
176
|
break;
|
|
169
177
|
}
|
|
178
|
+
case 'enum': {
|
|
179
|
+
type = 'string';
|
|
180
|
+
enumData = parameter.type.names;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
170
183
|
default: {
|
|
171
184
|
break;
|
|
172
185
|
}
|
|
@@ -187,6 +200,7 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
|
|
|
187
200
|
type,
|
|
188
201
|
description,
|
|
189
202
|
items,
|
|
203
|
+
enum: enumData,
|
|
190
204
|
},
|
|
191
205
|
};
|
|
192
206
|
return accumulator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-jsonrpc-jsdoc",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Transform JSDoc-annotated JSON-RPC 2.0 methods into OpenAPI 3.0 specifications. Auto-generates REST API documentation with complete schemas, parameters, and endpoint definitions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|