@unispechq/unispec-schema 0.4.0 → 0.4.2
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 +170 -162
- package/examples/README.md +128 -0
- package/examples/invalid/config/additional-properties.json +26 -0
- package/examples/invalid/config/missing-service-name.json +22 -0
- package/examples/invalid/config/missing-version.json +6 -0
- package/examples/invalid/graphql-additional-properties.json +22 -0
- package/examples/invalid/graphql-missing-arg-type.json +26 -0
- package/examples/invalid/graphql-missing-name.json +19 -0
- package/examples/invalid/graphql-missing-schema.json +19 -0
- package/examples/invalid/mixed-invalid-protocol.json +26 -0
- package/examples/invalid/mixed-missing-graphql-schema.json +33 -0
- package/examples/invalid/mixed-multiple-errors.json +41 -0
- package/examples/invalid/rest-additional-properties.json +25 -0
- package/examples/invalid/rest-invalid-identifiers.json +29 -0
- package/examples/invalid/rest-invalid-method.json +23 -0
- package/examples/invalid/rest-missing-required.json +21 -0
- package/examples/invalid/websocket-additional-properties.json +27 -0
- package/examples/invalid/websocket-invalid-direction.json +27 -0
- package/examples/invalid/websocket-missing-channel-name.json +25 -0
- package/examples/invalid/websocket-missing-message-name.json +25 -0
- package/examples/valid/config/complete.json +61 -0
- package/examples/valid/config/minimal.json +8 -0
- package/examples/valid/graphql-complete.json +348 -0
- package/examples/valid/graphql-simple.json +34 -0
- package/examples/valid/mixed-complete.json +799 -0
- package/examples/valid/mixed-simple.json +56 -0
- package/examples/valid/rest-complete.json +539 -0
- package/examples/valid/rest-simple.json +279 -0
- package/examples/valid/websocket-complete.json +471 -0
- package/examples/valid/websocket-simple.json +116 -0
- package/index.cjs +7 -7
- package/index.d.ts +9 -9
- package/index.mjs +9 -9
- package/package.json +15 -6
- package/schema/index.json +19 -19
- package/schema/types/common.schema.json +195 -195
- package/schema/types/graphql.schema.json +172 -172
- package/schema/types/rest.schema.json +221 -226
- package/schema/types/schemas.schema.json +84 -84
- package/schema/types/service.schema.json +158 -158
- package/schema/types/websocket.schema.json +185 -190
- package/schema/unispec-config.schema.json +509 -509
- package/schema/unispec-tests.schema.json +368 -378
- package/schema/unispec.schema.json +18 -23
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/service.schema.json",
|
|
4
|
+
"title": "UniSpec Service",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["name"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
10
|
+
},
|
|
11
|
+
"description": {
|
|
12
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
13
|
+
},
|
|
14
|
+
"version": {
|
|
15
|
+
"$ref": "./common.schema.json#/$defs/Version"
|
|
16
|
+
},
|
|
17
|
+
"tags": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"description": "Tags for grouping and categorizing the service.",
|
|
20
|
+
"items": {
|
|
21
|
+
"$ref": "./common.schema.json#/$defs/Tag"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"baseUrl": {
|
|
25
|
+
"$ref": "./common.schema.json#/$defs/Url",
|
|
26
|
+
"description": "Base URL for the service. Used as the default prefix for all protocol endpoints."
|
|
27
|
+
},
|
|
28
|
+
"contact": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Contact information for the service.",
|
|
31
|
+
"properties": {
|
|
32
|
+
"name": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Contact name."
|
|
35
|
+
},
|
|
36
|
+
"email": {
|
|
37
|
+
"$ref": "./common.schema.json#/$defs/Email"
|
|
38
|
+
},
|
|
39
|
+
"url": {
|
|
40
|
+
"$ref": "./common.schema.json#/$defs/Url"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
},
|
|
45
|
+
"license": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "License information for the service.",
|
|
48
|
+
"properties": {
|
|
49
|
+
"name": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "License name."
|
|
52
|
+
},
|
|
53
|
+
"url": {
|
|
54
|
+
"$ref": "./common.schema.json#/$defs/Url"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
},
|
|
59
|
+
"servers": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"description": "Alternative servers where the service is available.",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"properties": {
|
|
65
|
+
"url": {
|
|
66
|
+
"$ref": "./common.schema.json#/$defs/Url"
|
|
67
|
+
},
|
|
68
|
+
"description": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Description of the server."
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"additionalProperties": false
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"protocols": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"description": "Protocol-specific API surfaces exposed by this service.",
|
|
79
|
+
"properties": {
|
|
80
|
+
"rest": {
|
|
81
|
+
"$ref": "./rest.schema.json#"
|
|
82
|
+
},
|
|
83
|
+
"graphql": {
|
|
84
|
+
"$ref": "./graphql.schema.json#"
|
|
85
|
+
},
|
|
86
|
+
"websocket": {
|
|
87
|
+
"$ref": "./websocket.schema.json#"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"additionalProperties": false
|
|
91
|
+
},
|
|
92
|
+
"schemas": {
|
|
93
|
+
"$ref": "./schemas.schema.json#"
|
|
94
|
+
},
|
|
95
|
+
"securitySchemes": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"description": "Authentication mechanisms available for this service.",
|
|
98
|
+
"additionalProperties": {
|
|
99
|
+
"$ref": "./common.schema.json#/$defs/SecurityScheme"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"rateLimit": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"description": "Rate limiting configuration for the service.",
|
|
105
|
+
"properties": {
|
|
106
|
+
"requestsPerMinute": {
|
|
107
|
+
"type": "integer",
|
|
108
|
+
"minimum": 0,
|
|
109
|
+
"description": "Maximum requests per minute."
|
|
110
|
+
},
|
|
111
|
+
"requestsPerHour": {
|
|
112
|
+
"type": "integer",
|
|
113
|
+
"minimum": 0,
|
|
114
|
+
"description": "Maximum requests per hour."
|
|
115
|
+
},
|
|
116
|
+
"requestsPerDay": {
|
|
117
|
+
"type": "integer",
|
|
118
|
+
"minimum": 0,
|
|
119
|
+
"description": "Maximum requests per day."
|
|
120
|
+
},
|
|
121
|
+
"burstLimit": {
|
|
122
|
+
"type": "integer",
|
|
123
|
+
"minimum": 0,
|
|
124
|
+
"description": "Maximum burst requests allowed."
|
|
125
|
+
},
|
|
126
|
+
"perUser": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"description": "Whether rate limiting is applied per user.",
|
|
129
|
+
"default": false
|
|
130
|
+
},
|
|
131
|
+
"perApiKey": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"description": "Whether rate limiting is applied per API key.",
|
|
134
|
+
"default": false
|
|
135
|
+
},
|
|
136
|
+
"customKey": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"description": "Custom key for rate limiting (e.g., IP address, organization ID)."
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
},
|
|
143
|
+
"compliance": {
|
|
144
|
+
"type": "array",
|
|
145
|
+
"description": "Compliance frameworks the service adheres to.",
|
|
146
|
+
"items": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"enum": ["GDPR", "SOC2", "HIPAA", "PCI-DSS", "ISO27001", "CCPA"]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"dataClassification": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"description": "Data classification level for the service.",
|
|
154
|
+
"enum": ["public", "internal", "confidential", "restricted"]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
}
|