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.
- package/README.md +12 -12
- package/index.mjs +4 -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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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)
|
|
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
|
|
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
|
|
143
|
+
[type] = enumData;
|
|
143
144
|
constant = true;
|
|
144
145
|
} else {
|
|
145
146
|
type = undefined;
|