@novice1/api-doc-json-helper 0.1.1 → 0.1.3
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 +10 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,14 +29,15 @@ const router = routing()
|
|
|
29
29
|
tags: ['default'],
|
|
30
30
|
parameters: {
|
|
31
31
|
query: {
|
|
32
|
-
|
|
32
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
33
33
|
type: 'object',
|
|
34
34
|
properties: {
|
|
35
35
|
version: {
|
|
36
36
|
type: 'string',
|
|
37
37
|
description: 'version number',
|
|
38
38
|
enum: ['1','2','3'],
|
|
39
|
-
default: '2'
|
|
39
|
+
default: '2',
|
|
40
|
+
nullable: true
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -50,7 +51,7 @@ const router = routing()
|
|
|
50
51
|
|
|
51
52
|
### Recommended
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
It's [recommended](https://github.com/kisiwu/novice-validator-json?tab=readme-ov-file#best-practices) to keep your schemas isolated from other properties of `parameters`.
|
|
54
55
|
|
|
55
56
|
```ts
|
|
56
57
|
import {
|
|
@@ -75,14 +76,15 @@ const router = routing()
|
|
|
75
76
|
// recommended
|
|
76
77
|
jsonSchemas: {
|
|
77
78
|
query: {
|
|
78
|
-
|
|
79
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
79
80
|
type: 'object',
|
|
80
81
|
properties: {
|
|
81
82
|
version: {
|
|
82
83
|
type: 'string',
|
|
83
84
|
description: 'version number',
|
|
84
85
|
enum: ['1','2','3'],
|
|
85
|
-
default: '2'
|
|
86
|
+
default: '2',
|
|
87
|
+
nullable: true
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
@@ -120,14 +122,15 @@ const router = routing()
|
|
|
120
122
|
|
|
121
123
|
jsonSchemas: {
|
|
122
124
|
query: {
|
|
123
|
-
|
|
125
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
124
126
|
type: 'object',
|
|
125
127
|
properties: {
|
|
126
128
|
version: {
|
|
127
129
|
type: 'string',
|
|
128
130
|
description: 'version number',
|
|
129
131
|
enum: ['1','2','3'],
|
|
130
|
-
default: '2'
|
|
132
|
+
default: '2',
|
|
133
|
+
nullable: true
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
}
|