@novice1/api-doc-json-helper 1.0.0-alpha.1 → 1.0.1
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 +13 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from '@novice1/api-doc-json-helper';
|
|
20
20
|
import routing from '@novice1/routing';
|
|
21
21
|
|
|
22
|
-
const openapi = new OpenAPI(OpenAPIJsonHelper);
|
|
22
|
+
const openapi = new OpenAPI({ helperClass: OpenAPIJsonHelper });
|
|
23
23
|
|
|
24
24
|
const router = routing()
|
|
25
25
|
.get({
|
|
@@ -62,9 +62,10 @@ import {
|
|
|
62
62
|
} from '@novice1/api-doc-json-helper';
|
|
63
63
|
import routing from '@novice1/routing';
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const openapi = new OpenAPI({
|
|
66
|
+
helperClass: OpenAPIJsonHelper,
|
|
67
|
+
helperSchemaProperty: 'schema' // recommended
|
|
68
|
+
});
|
|
68
69
|
|
|
69
70
|
const router = routing()
|
|
70
71
|
.get({
|
|
@@ -74,7 +75,7 @@ const router = routing()
|
|
|
74
75
|
tags: ['default'],
|
|
75
76
|
parameters: {
|
|
76
77
|
// recommended
|
|
77
|
-
|
|
78
|
+
schema: {
|
|
78
79
|
query: {
|
|
79
80
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
80
81
|
type: 'object',
|
|
@@ -94,7 +95,7 @@ const router = routing()
|
|
|
94
95
|
res.json(req.query.version)
|
|
95
96
|
});
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
// ...
|
|
98
99
|
```
|
|
99
100
|
|
|
100
101
|
## Postman Specification
|
|
@@ -108,9 +109,10 @@ import {
|
|
|
108
109
|
} from '@novice1/api-doc-json-helper';
|
|
109
110
|
import routing from '@novice1/routing';
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const postman = new Postman({
|
|
113
|
+
helperClass: PostmanJsonHelper,
|
|
114
|
+
helperSchemaProperty: 'schema'
|
|
115
|
+
});
|
|
114
116
|
|
|
115
117
|
const router = routing()
|
|
116
118
|
.get({
|
|
@@ -119,8 +121,7 @@ const router = routing()
|
|
|
119
121
|
auth: true,
|
|
120
122
|
tags: ['default'],
|
|
121
123
|
parameters: {
|
|
122
|
-
|
|
123
|
-
jsonSchemas: {
|
|
124
|
+
schema: {
|
|
124
125
|
query: {
|
|
125
126
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
126
127
|
type: 'object',
|
|
@@ -141,7 +142,7 @@ const router = routing()
|
|
|
141
142
|
res.json(req.query.version)
|
|
142
143
|
});
|
|
143
144
|
|
|
144
|
-
|
|
145
|
+
// ...
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
## References
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novice1/api-doc-json-helper",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"json"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@novice1/api-doc-generator": "^1.0.0
|
|
28
|
+
"@novice1/api-doc-generator": "^1.0.0",
|
|
29
29
|
"tslib": "^2.8.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|