openapi-jsonrpc-jsdoc 1.2.6 → 1.3.0
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 +2 -2
- package/{index.js → index.mjs} +4 -6
- package/package.json +9 -8
package/README.md
CHANGED
package/{index.js → index.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import jsdocx from 'jsdoc-x';
|
|
2
2
|
|
|
3
|
-
async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, servers, api = '/' }) {
|
|
3
|
+
export default async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, servers, api = '/' }) {
|
|
4
4
|
const [package_, ...documents] = await jsdocx.parse({
|
|
5
5
|
files,
|
|
6
6
|
package: packageUrl,
|
|
@@ -77,7 +77,7 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
|
|
|
77
77
|
if (!isJsonRpc) {
|
|
78
78
|
continue prepare;
|
|
79
79
|
}
|
|
80
|
-
const apiName = module.meta.filename.replace(
|
|
80
|
+
const apiName = module.meta.filename.replace(/\.js$/, '');
|
|
81
81
|
|
|
82
82
|
const schema = {
|
|
83
83
|
post: {
|
|
@@ -103,7 +103,7 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
|
|
|
103
103
|
content: {
|
|
104
104
|
'application/json': {
|
|
105
105
|
schema: {
|
|
106
|
-
$ref: '#/components/schemas/Error'
|
|
106
|
+
$ref: '#/components/schemas/Error',
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -245,5 +245,3 @@ async function openapiJsonrpcJsdoc({ files, securitySchemes = {}, packageUrl, se
|
|
|
245
245
|
}
|
|
246
246
|
return temporaryDocument;
|
|
247
247
|
}
|
|
248
|
-
|
|
249
|
-
module.exports = openapiJsonrpcJsdoc;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-jsonrpc-jsdoc",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Transform JSDoc-annotated JSON-RPC 2.0 methods into OpenAPI
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Transform JSDoc-annotated JSON-RPC 2.0 methods into OpenAPI specifications.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "NODE_NO_WARNINGS=1 ava test/*.test.js"
|
|
8
9
|
},
|
|
@@ -14,8 +15,8 @@
|
|
|
14
15
|
"openapi jsdoc",
|
|
15
16
|
"open api js doc",
|
|
16
17
|
"postman jsdoc",
|
|
17
|
-
"swagger
|
|
18
|
-
"openapi
|
|
18
|
+
"swagger jsdoc",
|
|
19
|
+
"openapi jsdoc",
|
|
19
20
|
"json-rpc openapi",
|
|
20
21
|
"json-rpc swagger",
|
|
21
22
|
"jsonrpc openapi",
|
|
@@ -31,11 +32,11 @@
|
|
|
31
32
|
"jsdoc-x": "~4.1.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"ava": "~
|
|
35
|
-
"express": "~5.1
|
|
36
|
-
"express-openapi-validator": "~5.6.
|
|
35
|
+
"ava": "~6.4.1",
|
|
36
|
+
"express": "~5.2.1",
|
|
37
|
+
"express-openapi-validator": "~5.6.1"
|
|
37
38
|
},
|
|
38
39
|
"engines": {
|
|
39
|
-
"node": ">=
|
|
40
|
+
"node": ">= 22"
|
|
40
41
|
}
|
|
41
42
|
}
|