@novice1/api-doc-json-helper 1.0.0-alpha.1 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +13 -12
  2. package/package.json +1 -1
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
- OpenAPIJsonHelper.schemaProperty = 'jsonSchemas' // recommended
66
-
67
- const openapi = new OpenAPI(OpenAPIJsonHelper);
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
- jsonSchemas: {
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
- PostmanJsonHelper.schemaProperty = 'jsonSchemas'
112
-
113
- const postman = new Postman(PostmanJsonHelper);
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.0-alpha.1",
3
+ "version": "1.0.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {