openapi-jsonrpc-jsdoc 1.2.4 → 1.2.5

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.
Files changed (2) hide show
  1. package/index.js +18 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -147,6 +147,9 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
147
147
 
148
148
  const propertiesParameters = module.params.reduce(
149
149
  (accumulator, parameter) => {
150
+ if (parameter.name.startsWith('_')) {
151
+ return accumulator;
152
+ }
150
153
  if (!parameter.type) {
151
154
  throw new Error('JSDoc parameter error: ' + apiName);
152
155
  }
@@ -164,6 +167,7 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
164
167
  }
165
168
  let items;
166
169
  let enumData;
170
+
167
171
  switch (type) {
168
172
  case 'Array.<string>': {
169
173
  type = 'array';
@@ -198,15 +202,20 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
198
202
  if (!parameter.optional) {
199
203
  accumulator.required.push(name);
200
204
  }
201
- accumulator.properties = {
202
- ...accumulator.properties,
203
- [name]: {
204
- type,
205
- description,
206
- items,
207
- enum: enumData,
208
- },
209
- };
205
+ accumulator.properties[name] = accumulator.properties[name] ?? {};
206
+ if (type) {
207
+ accumulator.properties[name].type = type;
208
+ }
209
+ if (description) {
210
+ accumulator.properties[name].description = description;
211
+ }
212
+ if (items) {
213
+ accumulator.properties[name].items = items;
214
+ }
215
+ if (enumData) {
216
+ accumulator.properties[name].enum = enumData;
217
+ }
218
+
210
219
  return accumulator;
211
220
  },
212
221
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-jsonrpc-jsdoc",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
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": {