openapi-jsonrpc-jsdoc 1.5.4 → 1.5.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 (3) hide show
  1. package/README.md +12 -12
  2. package/index.mjs +4 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -37,19 +37,19 @@ module.exports = (parameters) => {
37
37
  ```js
38
38
  const openapiJSONRpcJSDoc = require('openapi-jsonrpc-jsdoc');
39
39
  openapiJSONRpcJSDoc({
40
- api: '/',
41
- servers: [
42
- {
43
- url: '0.0.0.0:8080',
44
- },
45
- ],
46
- info: {
47
- title: 'Test API',
48
- },
49
- packageUrl: './package.json',
50
- files: './api/*.js',
40
+ api: '/',
41
+ servers: [
42
+ {
43
+ url: '0.0.0.0:8080',
44
+ },
45
+ ],
46
+ info: {
47
+ title: 'Test API',
48
+ },
49
+ packageUrl: './package.json',
50
+ files: './api/*.js',
51
51
  }).then(data => {
52
- JSON.stringify(data, null, 2);// openapi.json
52
+ JSON.stringify(data, null, 2); // openapi.json
53
53
  });
54
54
  ```
55
55
 
package/index.mjs CHANGED
@@ -36,6 +36,7 @@ function normalizeString(s) {
36
36
  ) {
37
37
  return s.slice(1, -1);
38
38
  }
39
+ return s;
39
40
  }
40
41
 
41
42
  function resolveSchemaFromTypeNames(names) {
@@ -102,9 +103,9 @@ function resolveSchemaFromTypeNames(names) {
102
103
  } else if (isBigInt64(n)) {
103
104
  return n;
104
105
  } else if (typeof n === 'string') {
105
- return normalizeString(n)
106
+ return normalizeString(n);
106
107
  }
107
- return s;
108
+ return n;
108
109
  });
109
110
 
110
111
  if (enumData.every(n => Number.isSafeInteger(n))) {
@@ -139,7 +140,7 @@ function resolveSchemaFromTypeNames(names) {
139
140
  } else if (enumData.every(n => typeof n === 'string')) {
140
141
  type = 'string';
141
142
  } else if (enumData.length === 1) {
142
- type = enumData[0];
143
+ [type] = enumData;
143
144
  constant = true;
144
145
  } else {
145
146
  type = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-jsonrpc-jsdoc",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "Transform JSDoc-annotated JSON-RPC 2.0 methods into OpenAPI specifications.",
5
5
  "main": "index.mjs",
6
6
  "type": "module",