@unispechq/unispec-core 0.3.2 → 0.3.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.
Files changed (265) hide show
  1. package/dist/cjs/src/cache/cache-factory.js +1 -1
  2. package/dist/cjs/src/cache/cache-manager.js +2 -2
  3. package/dist/cjs/src/cache/hash-utils.js +1 -1
  4. package/dist/cjs/src/cache/hashing.js +1 -1
  5. package/dist/cjs/src/cache/index.js +5 -5
  6. package/dist/cjs/src/cache/lru-cache.js +1 -1
  7. package/dist/cjs/src/diff/core.js +2 -2
  8. package/dist/cjs/src/diff/enhanced-diff.js +5 -5
  9. package/dist/cjs/src/diff/index.js +8 -8
  10. package/dist/cjs/src/errors/config-error.js +1 -1
  11. package/dist/cjs/src/errors/error-factory.js +7 -7
  12. package/dist/cjs/src/errors/index.js +8 -8
  13. package/dist/cjs/src/errors/loader-error.js +1 -1
  14. package/dist/cjs/src/errors/reference-error.js +1 -1
  15. package/dist/cjs/src/errors/schema-error.js +1 -1
  16. package/dist/cjs/src/errors/security-error.js +1 -1
  17. package/dist/cjs/src/errors/semantic-error.js +1 -1
  18. package/dist/cjs/src/index.js +13 -13
  19. package/dist/cjs/src/loader/index.js +4 -4
  20. package/dist/cjs/src/loader/security-validator.js +1 -1
  21. package/dist/cjs/src/loader/unispec-loader.js +3 -3
  22. package/dist/cjs/src/loader/yaml-loader.js +1 -1
  23. package/dist/cjs/src/normalizer/core.js +4 -4
  24. package/dist/cjs/src/normalizer/index.js +1 -1
  25. package/dist/cjs/src/optimizer/core.js +2 -2
  26. package/dist/cjs/src/optimizer/index.js +3 -3
  27. package/dist/cjs/src/optimizer/optimization-functions.js +2 -2
  28. package/dist/cjs/src/schemas/dedupe.js +1 -1
  29. package/dist/cjs/src/schemas/index.js +3 -3
  30. package/dist/cjs/src/schemas/resolver.js +1 -1
  31. package/dist/cjs/src/validator/ajv-validator.js +1 -1
  32. package/dist/cjs/src/validator/config-validator-main.js +4 -4
  33. package/dist/cjs/src/validator/config-validator.js +1 -1
  34. package/dist/cjs/src/validator/index.js +7 -7
  35. package/dist/cjs/src/validator/reference-validator.js +1 -1
  36. package/dist/cjs/src/validator/tests-validator.js +2 -2
  37. package/dist/cjs/src/validator/unispec-validator.js +5 -5
  38. package/dist/cjs/src/validator/validator-factory.js +1 -1
  39. package/dist/cjs/tests/cache/cache.test.js +4 -4
  40. package/dist/cjs/tests/cache/utils.js +1 -1
  41. package/dist/cjs/tests/diff/diff-annotators.test.js +2 -2
  42. package/dist/cjs/tests/diff/diff-comprehensive.test.js +2 -2
  43. package/dist/cjs/tests/diff/diff-extended.test.js +2 -2
  44. package/dist/cjs/tests/diff/diff.test.js +2 -2
  45. package/dist/cjs/tests/diff/utils.js +1 -1
  46. package/dist/cjs/tests/errors/errors-integration.test.js +3 -3
  47. package/dist/cjs/tests/errors/errors.test.js +2 -2
  48. package/dist/cjs/tests/errors/utils.js +1 -1
  49. package/dist/cjs/tests/loader/integration.test.js +2 -2
  50. package/dist/cjs/tests/loader/loader.test.js +2 -2
  51. package/dist/cjs/tests/normalizer/normalizer-comprehensive.test.js +2 -2
  52. package/dist/cjs/tests/normalizer/normalizer-invalid.test.js +2 -2
  53. package/dist/cjs/tests/normalizer/normalizer-valid.test.js +2 -2
  54. package/dist/cjs/tests/normalizer/utils.js +1 -1
  55. package/dist/cjs/tests/optimizer/compress-references.test.js +2 -2
  56. package/dist/cjs/tests/optimizer/deduplication.test.js +2 -2
  57. package/dist/cjs/tests/optimizer/integration.test.js +3 -3
  58. package/dist/cjs/tests/optimizer/optimization-report.test.js +2 -2
  59. package/dist/cjs/tests/optimizer/optimize-document.test.js +2 -2
  60. package/dist/cjs/tests/optimizer/orphaned-schemas.test.js +2 -2
  61. package/dist/cjs/tests/optimizer/sort-schemas.test.js +2 -2
  62. package/dist/cjs/tests/optimizer/utils.js +1 -1
  63. package/dist/cjs/tests/schemas/schemas-edge-cases.test.js +3 -3
  64. package/dist/cjs/tests/schemas/schemas.test.js +3 -3
  65. package/dist/cjs/tests/schemas/utils.js +1 -1
  66. package/dist/cjs/tests/validator/config-validator.test.js +2 -2
  67. package/dist/cjs/tests/validator/unispec-validator.test.js +2 -2
  68. package/dist/cjs/tests/validator/utils.js +1 -1
  69. package/package.json +1 -1
  70. package/dist/cache/cache-factory.d.ts +0 -31
  71. package/dist/cache/cache-factory.js +0 -65
  72. package/dist/cache/cache-manager.d.ts +0 -62
  73. package/dist/cache/cache-manager.js +0 -122
  74. package/dist/cache/constants.d.ts +0 -21
  75. package/dist/cache/constants.js +0 -22
  76. package/dist/cache/hash-utils.d.ts +0 -21
  77. package/dist/cache/hash-utils.js +0 -35
  78. package/dist/cache/hashing.d.ts +0 -19
  79. package/dist/cache/hashing.js +0 -197
  80. package/dist/cache/index.d.ts +0 -6
  81. package/dist/cache/index.js +0 -10
  82. package/dist/cache/lru-cache.d.ts +0 -56
  83. package/dist/cache/lru-cache.js +0 -161
  84. package/dist/cache/types.d.ts +0 -24
  85. package/dist/cache/types.js +0 -4
  86. package/dist/cjs/cache/cache-factory.js +0 -72
  87. package/dist/cjs/cache/cache-manager.js +0 -126
  88. package/dist/cjs/cache/constants.js +0 -25
  89. package/dist/cjs/cache/hash-utils.js +0 -41
  90. package/dist/cjs/cache/hashing.js +0 -236
  91. package/dist/cjs/cache/index.js +0 -26
  92. package/dist/cjs/cache/lru-cache.js +0 -165
  93. package/dist/cjs/cache/types.js +0 -5
  94. package/dist/cjs/diff/annotators.js +0 -159
  95. package/dist/cjs/diff/change-reports.js +0 -369
  96. package/dist/cjs/diff/core.js +0 -158
  97. package/dist/cjs/diff/enhanced-diff.js +0 -79
  98. package/dist/cjs/diff/impact-strategies-refactored.js +0 -230
  99. package/dist/cjs/diff/impact-strategies.js +0 -219
  100. package/dist/cjs/diff/index.js +0 -27
  101. package/dist/cjs/diff/metrics-calculator.js +0 -69
  102. package/dist/cjs/diff/risk-calculator.js +0 -58
  103. package/dist/cjs/diff/suggestion-generator.js +0 -78
  104. package/dist/cjs/diff/types.js +0 -11
  105. package/dist/cjs/errors/base-error.js +0 -33
  106. package/dist/cjs/errors/config-error.js +0 -11
  107. package/dist/cjs/errors/error-factory.js +0 -48
  108. package/dist/cjs/errors/index.js +0 -19
  109. package/dist/cjs/errors/loader-error.js +0 -11
  110. package/dist/cjs/errors/reference-error.js +0 -11
  111. package/dist/cjs/errors/schema-error.js +0 -11
  112. package/dist/cjs/errors/security-error.js +0 -11
  113. package/dist/cjs/errors/semantic-error.js +0 -11
  114. package/dist/cjs/generated-schemas.js +0 -2100
  115. package/dist/cjs/index.js +0 -59
  116. package/dist/cjs/loader/index.js +0 -13
  117. package/dist/cjs/loader/security-validator.js +0 -53
  118. package/dist/cjs/loader/types.js +0 -11
  119. package/dist/cjs/loader/unispec-loader.js +0 -84
  120. package/dist/cjs/loader/yaml-loader.js +0 -76
  121. package/dist/cjs/normalizer/core.js +0 -32
  122. package/dist/cjs/normalizer/graphql-normalizer.js +0 -67
  123. package/dist/cjs/normalizer/index.js +0 -7
  124. package/dist/cjs/normalizer/rest-normalizer.js +0 -51
  125. package/dist/cjs/normalizer/types.js +0 -2
  126. package/dist/cjs/normalizer/utils.js +0 -33
  127. package/dist/cjs/normalizer/websocket-normalizer.js +0 -81
  128. package/dist/cjs/optimizer/core.js +0 -115
  129. package/dist/cjs/optimizer/index.js +0 -17
  130. package/dist/cjs/optimizer/optimization-functions.js +0 -185
  131. package/dist/cjs/optimizer/types.js +0 -2
  132. package/dist/cjs/optimizer/utils.js +0 -32
  133. package/dist/cjs/schemas/dedupe.js +0 -100
  134. package/dist/cjs/schemas/index.js +0 -14
  135. package/dist/cjs/schemas/resolver.js +0 -41
  136. package/dist/cjs/schemas/utils.js +0 -53
  137. package/dist/cjs/types/index.js +0 -2
  138. package/dist/cjs/validator/ajv-validator.js +0 -82
  139. package/dist/cjs/validator/config-validator-main.js +0 -34
  140. package/dist/cjs/validator/config-validator.js +0 -17
  141. package/dist/cjs/validator/index.js +0 -23
  142. package/dist/cjs/validator/object-traversal.js +0 -112
  143. package/dist/cjs/validator/reference-validator.js +0 -233
  144. package/dist/cjs/validator/schema-references.js +0 -116
  145. package/dist/cjs/validator/semantic-validator.js +0 -328
  146. package/dist/cjs/validator/tests-validator.js +0 -16
  147. package/dist/cjs/validator/types.js +0 -2
  148. package/dist/cjs/validator/unispec-validator.js +0 -84
  149. package/dist/cjs/validator/validator-factory.js +0 -77
  150. package/dist/cjs/versions.js +0 -147
  151. package/dist/diff/annotators.d.ts +0 -4
  152. package/dist/diff/annotators.js +0 -154
  153. package/dist/diff/change-reports.d.ts +0 -37
  154. package/dist/diff/change-reports.js +0 -366
  155. package/dist/diff/core.d.ts +0 -26
  156. package/dist/diff/core.js +0 -155
  157. package/dist/diff/enhanced-diff.d.ts +0 -51
  158. package/dist/diff/enhanced-diff.js +0 -76
  159. package/dist/diff/impact-strategies-refactored.d.ts +0 -69
  160. package/dist/diff/impact-strategies-refactored.js +0 -223
  161. package/dist/diff/impact-strategies.d.ts +0 -41
  162. package/dist/diff/impact-strategies.js +0 -212
  163. package/dist/diff/index.d.ts +0 -8
  164. package/dist/diff/index.js +0 -11
  165. package/dist/diff/metrics-calculator.d.ts +0 -23
  166. package/dist/diff/metrics-calculator.js +0 -65
  167. package/dist/diff/risk-calculator.d.ts +0 -23
  168. package/dist/diff/risk-calculator.js +0 -55
  169. package/dist/diff/suggestion-generator.d.ts +0 -18
  170. package/dist/diff/suggestion-generator.js +0 -74
  171. package/dist/diff/types.d.ts +0 -24
  172. package/dist/diff/types.js +0 -8
  173. package/dist/errors/base-error.d.ts +0 -20
  174. package/dist/errors/base-error.js +0 -29
  175. package/dist/errors/config-error.d.ts +0 -4
  176. package/dist/errors/config-error.js +0 -7
  177. package/dist/errors/error-factory.d.ts +0 -22
  178. package/dist/errors/error-factory.js +0 -45
  179. package/dist/errors/index.d.ts +0 -8
  180. package/dist/errors/index.js +0 -8
  181. package/dist/errors/loader-error.d.ts +0 -4
  182. package/dist/errors/loader-error.js +0 -7
  183. package/dist/errors/reference-error.d.ts +0 -4
  184. package/dist/errors/reference-error.js +0 -7
  185. package/dist/errors/schema-error.d.ts +0 -4
  186. package/dist/errors/schema-error.js +0 -7
  187. package/dist/errors/security-error.d.ts +0 -4
  188. package/dist/errors/security-error.js +0 -7
  189. package/dist/errors/semantic-error.d.ts +0 -4
  190. package/dist/errors/semantic-error.js +0 -7
  191. package/dist/generated-schemas.d.ts +0 -2073
  192. package/dist/generated-schemas.js +0 -2097
  193. package/dist/index.cjs +0 -59
  194. package/dist/index.d.ts +0 -13
  195. package/dist/index.js +0 -43
  196. package/dist/loader/index.d.ts +0 -5
  197. package/dist/loader/index.js +0 -5
  198. package/dist/loader/security-validator.d.ts +0 -5
  199. package/dist/loader/security-validator.js +0 -50
  200. package/dist/loader/types.d.ts +0 -30
  201. package/dist/loader/types.js +0 -8
  202. package/dist/loader/unispec-loader.d.ts +0 -10
  203. package/dist/loader/unispec-loader.js +0 -81
  204. package/dist/loader/yaml-loader.d.ts +0 -10
  205. package/dist/loader/yaml-loader.js +0 -39
  206. package/dist/normalizer/core.d.ts +0 -24
  207. package/dist/normalizer/core.js +0 -29
  208. package/dist/normalizer/graphql-normalizer.d.ts +0 -8
  209. package/dist/normalizer/graphql-normalizer.js +0 -64
  210. package/dist/normalizer/index.d.ts +0 -2
  211. package/dist/normalizer/index.js +0 -3
  212. package/dist/normalizer/rest-normalizer.d.ts +0 -8
  213. package/dist/normalizer/rest-normalizer.js +0 -48
  214. package/dist/normalizer/types.d.ts +0 -7
  215. package/dist/normalizer/types.js +0 -1
  216. package/dist/normalizer/utils.d.ts +0 -14
  217. package/dist/normalizer/utils.js +0 -29
  218. package/dist/normalizer/websocket-normalizer.d.ts +0 -8
  219. package/dist/normalizer/websocket-normalizer.js +0 -78
  220. package/dist/optimizer/core.d.ts +0 -17
  221. package/dist/optimizer/core.js +0 -111
  222. package/dist/optimizer/index.d.ts +0 -4
  223. package/dist/optimizer/index.js +0 -7
  224. package/dist/optimizer/optimization-functions.d.ts +0 -32
  225. package/dist/optimizer/optimization-functions.js +0 -179
  226. package/dist/optimizer/types.d.ts +0 -28
  227. package/dist/optimizer/types.js +0 -1
  228. package/dist/optimizer/utils.d.ts +0 -7
  229. package/dist/optimizer/utils.js +0 -29
  230. package/dist/schemas/dedupe.d.ts +0 -9
  231. package/dist/schemas/dedupe.js +0 -97
  232. package/dist/schemas/index.d.ts +0 -3
  233. package/dist/schemas/index.js +0 -6
  234. package/dist/schemas/resolver.d.ts +0 -19
  235. package/dist/schemas/resolver.js +0 -37
  236. package/dist/schemas/utils.d.ts +0 -20
  237. package/dist/schemas/utils.js +0 -49
  238. package/dist/types/index.d.ts +0 -433
  239. package/dist/types/index.js +0 -1
  240. package/dist/validator/ajv-validator.d.ts +0 -15
  241. package/dist/validator/ajv-validator.js +0 -75
  242. package/dist/validator/config-validator-main.d.ts +0 -10
  243. package/dist/validator/config-validator-main.js +0 -31
  244. package/dist/validator/config-validator.d.ts +0 -5
  245. package/dist/validator/config-validator.js +0 -14
  246. package/dist/validator/index.d.ts +0 -10
  247. package/dist/validator/index.js +0 -11
  248. package/dist/validator/object-traversal.d.ts +0 -52
  249. package/dist/validator/object-traversal.js +0 -104
  250. package/dist/validator/reference-validator.d.ts +0 -31
  251. package/dist/validator/reference-validator.js +0 -230
  252. package/dist/validator/schema-references.d.ts +0 -23
  253. package/dist/validator/schema-references.js +0 -111
  254. package/dist/validator/semantic-validator.d.ts +0 -26
  255. package/dist/validator/semantic-validator.js +0 -325
  256. package/dist/validator/tests-validator.d.ts +0 -9
  257. package/dist/validator/tests-validator.js +0 -13
  258. package/dist/validator/types.d.ts +0 -29
  259. package/dist/validator/types.js +0 -1
  260. package/dist/validator/unispec-validator.d.ts +0 -15
  261. package/dist/validator/unispec-validator.js +0 -81
  262. package/dist/validator/validator-factory.d.ts +0 -10
  263. package/dist/validator/validator-factory.js +0 -73
  264. package/dist/versions.d.ts +0 -10
  265. package/dist/versions.js +0 -143
@@ -1,2097 +0,0 @@
1
- // Auto-generated schemas for validator
2
- // This file is generated during build time
3
- export const GENERATED_SCHEMAS = {
4
- unispec: {
5
- "$schema": "https://json-schema.org/draft/2020-12/schema",
6
- "$id": "https://unispec.dev/schema/unispec.schema.json",
7
- "title": "UniSpec document",
8
- "description": "Top-level UniSpec document describing a multi-protocol API service.",
9
- "type": "object",
10
- "required": [
11
- "unispecVersion",
12
- "service"
13
- ],
14
- "properties": {
15
- "unispecVersion": {
16
- "type": "string",
17
- "description": "UniSpec format version (SemVer)."
18
- },
19
- "service": {
20
- "$ref": "./types/service.schema.json#"
21
- }
22
- },
23
- "additionalProperties": false
24
- },
25
- unispecTests: {
26
- "$schema": "https://json-schema.org/draft/2020-12/schema",
27
- "$id": "https://unispec.dev/schema/unispec-tests.schema.json",
28
- "title": "UniSpec Tests document",
29
- "description": "Executable test cases targeting UniSpec-described services.",
30
- "type": "object",
31
- "required": [
32
- "uniSpecTestsVersion",
33
- "target",
34
- "tests"
35
- ],
36
- "properties": {
37
- "uniSpecTestsVersion": {
38
- "type": "string",
39
- "description": "UniSpec Tests format version (SemVer)."
40
- },
41
- "target": {
42
- "type": "object",
43
- "description": "Service and environment that this test document targets.",
44
- "required": [
45
- "serviceName"
46
- ],
47
- "properties": {
48
- "serviceName": {
49
- "type": "string",
50
- "description": "Identifier of the service, matching service.name from UniSpec."
51
- },
52
- "serviceVersion": {
53
- "type": "string",
54
- "description": "Optional service contract version, matching service.version when provided."
55
- },
56
- "environment": {
57
- "type": "string",
58
- "description": "Optional environment name, matching service.environments[].name when provided."
59
- }
60
- },
61
- "additionalProperties": false
62
- },
63
- "tests": {
64
- "type": "array",
65
- "description": "List of test cases.",
66
- "items": {
67
- "$ref": "#/$defs/TestCase"
68
- }
69
- },
70
- "loadTesting": {
71
- "type": "object",
72
- "description": "Load testing configuration for this test suite.",
73
- "properties": {
74
- "concurrentUsers": {
75
- "type": "integer",
76
- "minimum": 1,
77
- "description": "Number of concurrent users to simulate."
78
- },
79
- "duration": {
80
- "type": "string",
81
- "description": "Test duration (e.g., '10m', '1h')."
82
- },
83
- "rampUp": {
84
- "type": "string",
85
- "description": "Ramp-up time for reaching concurrent users."
86
- },
87
- "thresholds": {
88
- "type": "object",
89
- "description": "Performance thresholds.",
90
- "properties": {
91
- "responseTime": {
92
- "type": "string",
93
- "description": "Maximum response time (e.g., '200ms', '1s')."
94
- },
95
- "errorRate": {
96
- "type": "number",
97
- "minimum": 0,
98
- "maximum": 1,
99
- "description": "Maximum error rate (0.0 to 1.0)."
100
- },
101
- "throughput": {
102
- "type": "string",
103
- "description": "Minimum throughput (e.g., '100req/s')."
104
- }
105
- },
106
- "additionalProperties": false
107
- },
108
- "scenario": {
109
- "type": "object",
110
- "description": "Load test scenario configuration.",
111
- "properties": {
112
- "weight": {
113
- "type": "object",
114
- "description": "Test weights by tag or operation.",
115
- "additionalProperties": {
116
- "type": "integer",
117
- "minimum": 1
118
- }
119
- },
120
- "thinkTime": {
121
- "type": "string",
122
- "description": "User think time between requests."
123
- }
124
- },
125
- "additionalProperties": false
126
- }
127
- },
128
- "additionalProperties": false
129
- }
130
- },
131
- "$defs": {
132
- "TestCase": {
133
- "type": "object",
134
- "required": [
135
- "name",
136
- "target",
137
- "request",
138
- "expect"
139
- ],
140
- "properties": {
141
- "name": {
142
- "type": "string",
143
- "description": "Test identifier, unique within this document."
144
- },
145
- "description": {
146
- "type": "string",
147
- "description": "Human-readable description of the test case."
148
- },
149
- "target": {
150
- "$ref": "#/$defs/TestTarget"
151
- },
152
- "request": {
153
- "$ref": "#/$defs/TestRequest"
154
- },
155
- "expect": {
156
- "$ref": "#/$defs/TestExpect"
157
- },
158
- "tags": {
159
- "type": "array",
160
- "description": "Tags for grouping and filtering tests.",
161
- "items": {
162
- "type": "string"
163
- }
164
- }
165
- },
166
- "additionalProperties": false
167
- },
168
- "TestTarget": {
169
- "type": "object",
170
- "required": [
171
- "protocol",
172
- "operationId"
173
- ],
174
- "properties": {
175
- "protocol": {
176
- "type": "string",
177
- "description": "Protocol of the operation under test.",
178
- "enum": [
179
- "rest",
180
- "graphql",
181
- "websocket"
182
- ]
183
- },
184
- "operationId": {
185
- "type": "string",
186
- "description": "Operation identifier within the service (for example, REST route name)."
187
- },
188
- "environment": {
189
- "type": "string",
190
- "description": "Optional environment name overriding the document-level target.environment."
191
- }
192
- },
193
- "additionalProperties": false
194
- },
195
- "TestRequest": {
196
- "type": "object",
197
- "description": "Protocol-specific request definition.",
198
- "properties": {
199
- "rest": {
200
- "$ref": "#/$defs/RestRequest"
201
- },
202
- "graphql": {
203
- "$ref": "#/$defs/GraphQLRequest"
204
- },
205
- "websocket": {
206
- "$ref": "#/$defs/WebSocketRequest"
207
- }
208
- },
209
- "additionalProperties": false
210
- },
211
- "TestExpect": {
212
- "type": "object",
213
- "description": "Protocol-specific expectations.",
214
- "properties": {
215
- "rest": {
216
- "$ref": "#/$defs/RestExpect"
217
- },
218
- "graphql": {
219
- "$ref": "#/$defs/GraphQLExpect"
220
- },
221
- "websocket": {
222
- "$ref": "#/$defs/WebSocketExpect"
223
- }
224
- },
225
- "additionalProperties": false
226
- },
227
- "RestRequest": {
228
- "type": "object",
229
- "properties": {
230
- "params": {
231
- "type": "object",
232
- "properties": {
233
- "path": {
234
- "type": "object",
235
- "additionalProperties": true
236
- },
237
- "query": {
238
- "type": "object",
239
- "additionalProperties": true
240
- }
241
- },
242
- "additionalProperties": false
243
- },
244
- "headers": {
245
- "type": "object",
246
- "additionalProperties": true
247
- },
248
- "body": {
249
- "description": "Request body (arbitrary JSON value)."
250
- },
251
- "authProfile": {
252
- "type": "string",
253
- "description": "Identifier of an authentication profile configured in tooling."
254
- }
255
- },
256
- "additionalProperties": false
257
- },
258
- "RestExpect": {
259
- "type": "object",
260
- "required": [
261
- "status"
262
- ],
263
- "properties": {
264
- "status": {
265
- "description": "Expected HTTP status code or list of acceptable codes.",
266
- "oneOf": [
267
- {
268
- "type": "integer"
269
- },
270
- {
271
- "type": "array",
272
- "items": {
273
- "type": "integer"
274
- }
275
- }
276
- ]
277
- },
278
- "headers": {
279
- "type": "object",
280
- "description": "Expected headers (usually partial match).",
281
- "additionalProperties": true
282
- },
283
- "body": {
284
- "$ref": "#/$defs/BodyExpectation"
285
- }
286
- },
287
- "additionalProperties": false
288
- },
289
- "BodyExpectation": {
290
- "type": "object",
291
- "properties": {
292
- "mode": {
293
- "type": "string",
294
- "enum": [
295
- "exact",
296
- "contains",
297
- "schemaOnly",
298
- "snapshot"
299
- ],
300
- "description": "Assertion mode for the response body."
301
- },
302
- "json": {
303
- "description": "JSON value used for exact or contains mode."
304
- },
305
- "schemaRef": {
306
- "type": "string",
307
- "description": "Reference to a schema from service.schemas for schemaOnly mode. Recommended format: <SchemaName> (where SchemaName is a key in service.schemas). Tools may also accept a JSON Pointer in the form #/service/schemas/<SchemaName>."
308
- }
309
- },
310
- "additionalProperties": false
311
- },
312
- "GraphQLRequest": {
313
- "type": "object",
314
- "properties": {
315
- "operationName": {
316
- "type": "string"
317
- },
318
- "query": {
319
- "type": "string"
320
- },
321
- "variables": {
322
- "type": "object",
323
- "additionalProperties": true
324
- },
325
- "headers": {
326
- "type": "object",
327
- "additionalProperties": true
328
- },
329
- "authProfile": {
330
- "type": "string",
331
- "description": "Identifier of an authentication profile configured in tooling."
332
- }
333
- },
334
- "required": [
335
- "query"
336
- ],
337
- "additionalProperties": false
338
- },
339
- "GraphQLExpect": {
340
- "type": "object",
341
- "properties": {
342
- "data": {
343
- "description": "Expectations on the data field (exact or partial match)."
344
- },
345
- "errors": {
346
- "description": "Expectations on the errors field."
347
- },
348
- "bodyMode": {
349
- "type": "string",
350
- "description": "Optional control over how strictly data and errors are matched."
351
- }
352
- },
353
- "additionalProperties": false
354
- },
355
- "WebSocketRequest": {
356
- "type": "object",
357
- "properties": {
358
- "channel": {
359
- "type": "string",
360
- "description": "Channel identifier, matching protocols.websocket.channels[].name."
361
- },
362
- "direction": {
363
- "type": "string",
364
- "enum": [
365
- "publish",
366
- "subscribe",
367
- "both"
368
- ]
369
- },
370
- "messages": {
371
- "type": "array",
372
- "description": "Message actions (send/expect) forming a small interaction script.",
373
- "items": {
374
- "$ref": "#/$defs/WebSocketMessageAction"
375
- }
376
- },
377
- "authProfile": {
378
- "type": "string",
379
- "description": "Identifier of an authentication profile configured in tooling."
380
- }
381
- },
382
- "required": [
383
- "channel"
384
- ],
385
- "additionalProperties": false
386
- },
387
- "WebSocketMessageAction": {
388
- "type": "object",
389
- "required": [
390
- "type",
391
- "messageName"
392
- ],
393
- "properties": {
394
- "type": {
395
- "type": "string",
396
- "enum": [
397
- "send",
398
- "expect"
399
- ],
400
- "description": "Whether this action sends or expects a message."
401
- },
402
- "messageName": {
403
- "type": "string",
404
- "description": "Name of the message, matching protocols.websocket.channels[].messages[].name."
405
- },
406
- "payload": {
407
- "description": "Payload to send or expected payload structure."
408
- }
409
- },
410
- "additionalProperties": false
411
- },
412
- "WebSocketExpect": {
413
- "type": "object",
414
- "properties": {
415
- "messages": {
416
- "type": "array",
417
- "description": "Expected messages to be observed on the channel.",
418
- "items": {
419
- "$ref": "#/$defs/WebSocketMessageAction"
420
- }
421
- },
422
- "timeoutMs": {
423
- "type": "integer",
424
- "description": "Timeout for the WebSocket interaction in milliseconds."
425
- }
426
- },
427
- "additionalProperties": false
428
- }
429
- },
430
- "additionalProperties": false
431
- },
432
- unispecConfig: {
433
- "$schema": "https://json-schema.org/draft/2020-12/schema",
434
- "$id": "https://unispec.dev/schema/unispec-config.schema.json",
435
- "title": "UniSpec Config",
436
- "description": "Configuration file that describes how to locate UniSpec documents for one or more services.",
437
- "type": "object",
438
- "required": [
439
- "version",
440
- "services"
441
- ],
442
- "properties": {
443
- "version": {
444
- "type": "integer",
445
- "description": "Config format version.",
446
- "minimum": 1
447
- },
448
- "services": {
449
- "type": "array",
450
- "description": "List of services available in this config.",
451
- "items": {
452
- "$ref": "#/$defs/ServiceEntry"
453
- },
454
- "minItems": 1
455
- },
456
- "discovery": {
457
- "$ref": "#/$defs/Discovery"
458
- },
459
- "environments": {
460
- "type": "array",
461
- "description": "Named environments (for example, local, staging, prod) with optional overrides.",
462
- "items": {
463
- "$ref": "#/$defs/Environment"
464
- }
465
- }
466
- },
467
- "$defs": {
468
- "ServiceEntry": {
469
- "type": "object",
470
- "required": [
471
- "name",
472
- "spec"
473
- ],
474
- "properties": {
475
- "name": {
476
- "$ref": "./types/common.schema.json#/$defs/Identifier"
477
- },
478
- "baseUrl": {
479
- "type": "string",
480
- "description": "Service base URL. Can differ per service and can be overridden by environments."
481
- },
482
- "spec": {
483
- "$ref": "#/$defs/SpecReference"
484
- },
485
- "health": {
486
- "$ref": "#/$defs/Health"
487
- },
488
- "discovery": {
489
- "$ref": "#/$defs/Discovery"
490
- },
491
- "headers": {
492
- "type": "array",
493
- "description": "HTTP headers commonly used for accessing this service's UniSpec document.",
494
- "items": {
495
- "$ref": "#/$defs/Header"
496
- }
497
- },
498
- "security": {
499
- "type": "array",
500
- "description": "Security requirements for accessing this service's UniSpec document. Each item represents an alternative set of named security schemes.",
501
- "items": {
502
- "$ref": "#/$defs/SecurityRequirement"
503
- }
504
- }
505
- },
506
- "additionalProperties": false
507
- },
508
- "SpecReference": {
509
- "description": "Reference to a UniSpec document.",
510
- "oneOf": [
511
- {
512
- "type": "string",
513
- "description": "Backward-compatible spec reference. Tooling interprets it as a location string (for example, URL or file path)."
514
- },
515
- {
516
- "$ref": "#/$defs/HttpSpecReference"
517
- },
518
- {
519
- "$ref": "#/$defs/FileSpecReference"
520
- },
521
- {
522
- "$ref": "#/$defs/RegistrySpecReference"
523
- }
524
- ]
525
- },
526
- "HttpSpecReference": {
527
- "type": "object",
528
- "required": [
529
- "type"
530
- ],
531
- "properties": {
532
- "type": {
533
- "const": "http"
534
- },
535
- "url": {
536
- "type": "string",
537
- "description": "Absolute or relative URL to the UniSpec document (for example, https://... or /unispec.json)."
538
- },
539
- "path": {
540
- "type": "string",
541
- "description": "Backward-compatible alias for url (for example, /unispec.yaml)."
542
- }
543
- },
544
- "oneOf": [
545
- {
546
- "required": [
547
- "url"
548
- ]
549
- },
550
- {
551
- "required": [
552
- "path"
553
- ]
554
- }
555
- ],
556
- "additionalProperties": false
557
- },
558
- "FileSpecReference": {
559
- "type": "object",
560
- "required": [
561
- "type",
562
- "path"
563
- ],
564
- "properties": {
565
- "type": {
566
- "const": "file"
567
- },
568
- "path": {
569
- "type": "string",
570
- "description": "Path to the UniSpec document on disk (for example, ./path/to/unispec.json)."
571
- }
572
- },
573
- "additionalProperties": false
574
- },
575
- "RegistrySpecReference": {
576
- "type": "object",
577
- "required": [
578
- "type",
579
- "ref"
580
- ],
581
- "properties": {
582
- "type": {
583
- "const": "registry"
584
- },
585
- "ref": {
586
- "type": "string",
587
- "description": "Registry reference for resolving the UniSpec document."
588
- }
589
- },
590
- "additionalProperties": false
591
- },
592
- "Health": {
593
- "type": "object",
594
- "required": [
595
- "path"
596
- ],
597
- "properties": {
598
- "path": {
599
- "type": "string",
600
- "description": "HTTP path for a health check endpoint (for example, /ping)."
601
- }
602
- },
603
- "additionalProperties": false
604
- },
605
- "Discovery": {
606
- "type": "object",
607
- "properties": {
608
- "dnsTemplate": {
609
- "type": "string",
610
- "description": "DNS-based discovery template. Template variables: {service}, {env}. If environment is not set, {env} is replaced with an empty string."
611
- }
612
- },
613
- "additionalProperties": false
614
- },
615
- "Environment": {
616
- "type": "object",
617
- "required": [
618
- "name"
619
- ],
620
- "properties": {
621
- "name": {
622
- "type": "string",
623
- "description": "Environment name (for example, local, staging, prod)."
624
- },
625
- "overrides": {
626
- "$ref": "#/$defs/EnvironmentOverrides"
627
- },
628
- "observability": {
629
- "$ref": "#/$defs/Observability"
630
- },
631
- "deployment": {
632
- "$ref": "#/$defs/Deployment"
633
- },
634
- "dataResidency": {
635
- "type": "string",
636
- "description": "Geographic region where data is stored for compliance."
637
- },
638
- "audit": {
639
- "$ref": "#/$defs/Audit"
640
- }
641
- },
642
- "additionalProperties": false
643
- },
644
- "EnvironmentOverrides": {
645
- "type": "object",
646
- "properties": {
647
- "services": {
648
- "type": "object",
649
- "description": "Per-service overrides. Keys are service names.",
650
- "additionalProperties": {
651
- "$ref": "#/$defs/ServiceOverride"
652
- }
653
- }
654
- },
655
- "additionalProperties": false
656
- },
657
- "ServiceOverride": {
658
- "type": "object",
659
- "properties": {
660
- "baseUrl": {
661
- "type": "string",
662
- "description": "Override for service baseUrl in this environment."
663
- },
664
- "spec": {
665
- "$ref": "#/$defs/SpecReference"
666
- },
667
- "health": {
668
- "$ref": "#/$defs/Health"
669
- },
670
- "discovery": {
671
- "$ref": "#/$defs/Discovery"
672
- },
673
- "headers": {
674
- "type": "array",
675
- "description": "HTTP headers overrides for accessing this service's UniSpec document in this environment.",
676
- "items": {
677
- "$ref": "#/$defs/Header"
678
- }
679
- },
680
- "security": {
681
- "type": "array",
682
- "description": "Security requirements overrides for accessing this service's UniSpec document in this environment.",
683
- "items": {
684
- "$ref": "#/$defs/SecurityRequirement"
685
- }
686
- }
687
- },
688
- "additionalProperties": false
689
- },
690
- "Header": {
691
- "type": "object",
692
- "required": [
693
- "name"
694
- ],
695
- "properties": {
696
- "name": {
697
- "type": "string",
698
- "description": "Header name (case-insensitive)."
699
- },
700
- "description": {
701
- "type": "string",
702
- "description": "Human-readable description of the header."
703
- },
704
- "required": {
705
- "type": "boolean",
706
- "description": "Whether this header is required.",
707
- "default": false
708
- },
709
- "defaultValue": {
710
- "type": "string",
711
- "description": "Default value for the header."
712
- }
713
- },
714
- "additionalProperties": false
715
- },
716
- "SecurityRequirement": {
717
- "type": "array",
718
- "description": "Alternative set of named security schemes applied to a service or operation.",
719
- "items": {
720
- "$ref": "./types/common.schema.json#/$defs/Identifier"
721
- }
722
- },
723
- "Observability": {
724
- "type": "object",
725
- "description": "Observability configuration for the environment.",
726
- "properties": {
727
- "logging": {
728
- "type": "object",
729
- "properties": {
730
- "level": {
731
- "type": "string",
732
- "enum": [
733
- "debug",
734
- "info",
735
- "warn",
736
- "error"
737
- ],
738
- "description": "Logging level."
739
- },
740
- "format": {
741
- "type": "string",
742
- "enum": [
743
- "json",
744
- "text"
745
- ],
746
- "description": "Log format."
747
- },
748
- "fields": {
749
- "type": "array",
750
- "items": {
751
- "type": "string"
752
- },
753
- "description": "Additional fields to include in logs."
754
- }
755
- },
756
- "additionalProperties": false
757
- },
758
- "metrics": {
759
- "type": "object",
760
- "properties": {
761
- "enabled": {
762
- "type": "boolean",
763
- "description": "Whether metrics collection is enabled."
764
- },
765
- "endpoints": {
766
- "type": "array",
767
- "items": {
768
- "type": "string"
769
- },
770
- "description": "Metrics endpoints."
771
- },
772
- "customMetrics": {
773
- "type": "array",
774
- "items": {
775
- "$ref": "#/$defs/CustomMetric"
776
- },
777
- "description": "Custom metrics definitions."
778
- }
779
- },
780
- "additionalProperties": false
781
- },
782
- "tracing": {
783
- "type": "object",
784
- "properties": {
785
- "enabled": {
786
- "type": "boolean",
787
- "description": "Whether distributed tracing is enabled."
788
- },
789
- "samplingRate": {
790
- "type": "number",
791
- "minimum": 0,
792
- "maximum": 1,
793
- "description": "Sampling rate for traces (0.0 to 1.0)."
794
- },
795
- "exporter": {
796
- "type": "string",
797
- "description": "Tracing exporter (e.g., jaeger, zipkin)."
798
- }
799
- },
800
- "additionalProperties": false
801
- }
802
- },
803
- "additionalProperties": false
804
- },
805
- "CustomMetric": {
806
- "type": "object",
807
- "properties": {
808
- "name": {
809
- "type": "string",
810
- "description": "Metric name."
811
- },
812
- "type": {
813
- "type": "string",
814
- "enum": [
815
- "counter",
816
- "gauge",
817
- "histogram",
818
- "summary"
819
- ],
820
- "description": "Metric type."
821
- },
822
- "description": {
823
- "type": "string",
824
- "description": "Metric description."
825
- },
826
- "labels": {
827
- "type": "array",
828
- "items": {
829
- "type": "string"
830
- },
831
- "description": "Metric labels."
832
- }
833
- },
834
- "required": [
835
- "name",
836
- "type"
837
- ],
838
- "additionalProperties": false
839
- },
840
- "Deployment": {
841
- "type": "object",
842
- "description": "Deployment configuration for the environment.",
843
- "properties": {
844
- "kubernetes": {
845
- "$ref": "#/$defs/KubernetesConfig"
846
- },
847
- "docker": {
848
- "$ref": "#/$defs/DockerConfig"
849
- },
850
- "replicas": {
851
- "type": "integer",
852
- "minimum": 1,
853
- "description": "Number of replicas."
854
- },
855
- "resources": {
856
- "$ref": "#/$defs/Resources"
857
- }
858
- },
859
- "additionalProperties": false
860
- },
861
- "KubernetesConfig": {
862
- "type": "object",
863
- "properties": {
864
- "namespace": {
865
- "type": "string",
866
- "description": "Kubernetes namespace."
867
- },
868
- "image": {
869
- "type": "string",
870
- "description": "Container image."
871
- },
872
- "port": {
873
- "type": "integer",
874
- "description": "Container port."
875
- },
876
- "serviceType": {
877
- "type": "string",
878
- "enum": [
879
- "ClusterIP",
880
- "NodePort",
881
- "LoadBalancer"
882
- ],
883
- "description": "Kubernetes service type."
884
- },
885
- "ingress": {
886
- "type": "object",
887
- "properties": {
888
- "host": {
889
- "type": "string",
890
- "description": "Ingress host."
891
- },
892
- "path": {
893
- "type": "string",
894
- "description": "Ingress path."
895
- },
896
- "tls": {
897
- "type": "boolean",
898
- "description": "Whether TLS is enabled."
899
- }
900
- },
901
- "additionalProperties": false
902
- }
903
- },
904
- "additionalProperties": false
905
- },
906
- "DockerConfig": {
907
- "type": "object",
908
- "properties": {
909
- "image": {
910
- "type": "string",
911
- "description": "Docker image."
912
- },
913
- "port": {
914
- "type": "integer",
915
- "description": "Container port."
916
- },
917
- "environment": {
918
- "type": "object",
919
- "additionalProperties": {
920
- "type": "string"
921
- },
922
- "description": "Environment variables."
923
- },
924
- "volumes": {
925
- "type": "array",
926
- "items": {
927
- "type": "string"
928
- },
929
- "description": "Volume mounts."
930
- }
931
- },
932
- "additionalProperties": false
933
- },
934
- "Resources": {
935
- "type": "object",
936
- "properties": {
937
- "cpu": {
938
- "type": "string",
939
- "description": "CPU request/limit."
940
- },
941
- "memory": {
942
- "type": "string",
943
- "description": "Memory request/limit."
944
- },
945
- "storage": {
946
- "type": "string",
947
- "description": "Storage request/limit."
948
- }
949
- },
950
- "additionalProperties": false
951
- },
952
- "Audit": {
953
- "type": "object",
954
- "description": "Audit configuration for compliance.",
955
- "properties": {
956
- "enabled": {
957
- "type": "boolean",
958
- "description": "Whether audit logging is enabled."
959
- },
960
- "retention": {
961
- "type": "string",
962
- "description": "Audit log retention period."
963
- },
964
- "fields": {
965
- "type": "array",
966
- "items": {
967
- "type": "string"
968
- },
969
- "description": "Fields to include in audit logs."
970
- },
971
- "export": {
972
- "type": "object",
973
- "properties": {
974
- "format": {
975
- "type": "string",
976
- "enum": [
977
- "json",
978
- "csv"
979
- ],
980
- "description": "Export format."
981
- },
982
- "destination": {
983
- "type": "string",
984
- "description": "Export destination."
985
- }
986
- },
987
- "additionalProperties": false
988
- }
989
- },
990
- "additionalProperties": false
991
- }
992
- },
993
- "additionalProperties": false
994
- },
995
- subschemas: [
996
- {
997
- "$schema": "https://json-schema.org/draft/2020-12/schema",
998
- "$id": "https://unispec.dev/schema/types/common.schema.json",
999
- "title": "Common UniSpec definitions",
1000
- "$defs": {
1001
- "Identifier": {
1002
- "type": "string",
1003
- "description": "Identifier for services, operations, channels, etc.",
1004
- "pattern": "^[A-Za-z_][A-Za-z0-9_.:-]*$"
1005
- },
1006
- "Description": {
1007
- "type": "string",
1008
- "description": "Human-readable description text."
1009
- },
1010
- "Email": {
1011
- "type": "string",
1012
- "description": "Email address with validation.",
1013
- "format": "email",
1014
- "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
1015
- },
1016
- "Url": {
1017
- "type": "string",
1018
- "description": "URL with validation.",
1019
- "format": "uri",
1020
- "pattern": "^https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}.*$"
1021
- },
1022
- "Version": {
1023
- "type": "string",
1024
- "description": "Semantic version string (SemVer).",
1025
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
1026
- },
1027
- "Tag": {
1028
- "type": "string",
1029
- "description": "Tag for grouping operations and resources.",
1030
- "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
1031
- },
1032
- "SecurityScheme": {
1033
- "type": "object",
1034
- "discriminator": {
1035
- "propertyName": "type"
1036
- },
1037
- "oneOf": [
1038
- {
1039
- "$ref": "#/$defs/ApiKeyScheme"
1040
- },
1041
- {
1042
- "$ref": "#/$defs/HttpScheme"
1043
- },
1044
- {
1045
- "$ref": "#/$defs/OAuth2Scheme"
1046
- },
1047
- {
1048
- "$ref": "#/$defs/JwtScheme"
1049
- }
1050
- ]
1051
- },
1052
- "ApiKeyScheme": {
1053
- "type": "object",
1054
- "properties": {
1055
- "type": {
1056
- "const": "apiKey"
1057
- },
1058
- "name": {
1059
- "type": "string",
1060
- "description": "Name of the API key header or query parameter."
1061
- },
1062
- "in": {
1063
- "type": "string",
1064
- "enum": [
1065
- "header",
1066
- "query",
1067
- "cookie"
1068
- ],
1069
- "description": "Location of the API key."
1070
- },
1071
- "description": {
1072
- "type": "string",
1073
- "description": "Description of the API key usage."
1074
- }
1075
- },
1076
- "required": [
1077
- "type",
1078
- "name",
1079
- "in"
1080
- ],
1081
- "additionalProperties": false
1082
- },
1083
- "HttpScheme": {
1084
- "type": "object",
1085
- "properties": {
1086
- "type": {
1087
- "const": "http"
1088
- },
1089
- "scheme": {
1090
- "type": "string",
1091
- "enum": [
1092
- "basic",
1093
- "bearer",
1094
- "digest"
1095
- ],
1096
- "description": "HTTP authentication scheme."
1097
- },
1098
- "bearerFormat": {
1099
- "type": "string",
1100
- "description": "Format of the bearer token (e.g., JWT)."
1101
- },
1102
- "description": {
1103
- "type": "string",
1104
- "description": "Description of the HTTP authentication scheme."
1105
- }
1106
- },
1107
- "required": [
1108
- "type",
1109
- "scheme"
1110
- ],
1111
- "additionalProperties": false
1112
- },
1113
- "OAuth2Scheme": {
1114
- "type": "object",
1115
- "properties": {
1116
- "type": {
1117
- "const": "oauth2"
1118
- },
1119
- "flows": {
1120
- "type": "object",
1121
- "description": "OAuth2 authorization flows.",
1122
- "properties": {
1123
- "authorizationCode": {
1124
- "$ref": "#/$defs/OAuth2Flow"
1125
- },
1126
- "clientCredentials": {
1127
- "$ref": "#/$defs/OAuth2Flow"
1128
- },
1129
- "implicit": {
1130
- "$ref": "#/$defs/OAuth2Flow"
1131
- }
1132
- },
1133
- "additionalProperties": false
1134
- },
1135
- "description": {
1136
- "type": "string",
1137
- "description": "Description of the OAuth2 scheme."
1138
- }
1139
- },
1140
- "required": [
1141
- "type",
1142
- "flows"
1143
- ],
1144
- "additionalProperties": false
1145
- },
1146
- "JwtScheme": {
1147
- "type": "object",
1148
- "properties": {
1149
- "type": {
1150
- "const": "jwt"
1151
- },
1152
- "issuer": {
1153
- "type": "string",
1154
- "description": "JWT issuer URL."
1155
- },
1156
- "audience": {
1157
- "type": "array",
1158
- "items": {
1159
- "type": "string"
1160
- },
1161
- "description": "Allowed JWT audiences."
1162
- },
1163
- "algorithms": {
1164
- "type": "array",
1165
- "items": {
1166
- "type": "string"
1167
- },
1168
- "description": "Allowed JWT algorithms."
1169
- },
1170
- "description": {
1171
- "type": "string",
1172
- "description": "Description of the JWT scheme."
1173
- }
1174
- },
1175
- "required": [
1176
- "type"
1177
- ],
1178
- "additionalProperties": false
1179
- },
1180
- "OAuth2Flow": {
1181
- "type": "object",
1182
- "properties": {
1183
- "authorizationUrl": {
1184
- "type": "string",
1185
- "format": "uri",
1186
- "description": "Authorization URL."
1187
- },
1188
- "tokenUrl": {
1189
- "type": "string",
1190
- "format": "uri",
1191
- "description": "Token URL."
1192
- },
1193
- "refreshUrl": {
1194
- "type": "string",
1195
- "format": "uri",
1196
- "description": "Refresh token URL."
1197
- },
1198
- "scopes": {
1199
- "type": "object",
1200
- "description": "Available scopes.",
1201
- "additionalProperties": {
1202
- "type": "string"
1203
- }
1204
- }
1205
- },
1206
- "required": [
1207
- "authorizationUrl",
1208
- "tokenUrl",
1209
- "scopes"
1210
- ],
1211
- "additionalProperties": false
1212
- }
1213
- }
1214
- },
1215
- {
1216
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1217
- "$id": "https://unispec.dev/schema/types/graphql.schema.json",
1218
- "title": "GraphQL API surface",
1219
- "type": "object",
1220
- "$defs": {
1221
- "Argument": {
1222
- "type": "object",
1223
- "required": [
1224
- "name",
1225
- "type"
1226
- ],
1227
- "properties": {
1228
- "name": {
1229
- "type": "string",
1230
- "description": "Argument name as it appears in the GraphQL operation."
1231
- },
1232
- "type": {
1233
- "type": "string",
1234
- "description": "GraphQL type string (e.g., 'ID!', '[User]', 'PostFilter')."
1235
- },
1236
- "description": {
1237
- "type": "string",
1238
- "description": "Human-readable description of the argument."
1239
- },
1240
- "defaultValue": {
1241
- "description": "Default value for the argument (any JSON value)."
1242
- },
1243
- "deprecated": {
1244
- "type": "boolean",
1245
- "description": "Marks the argument as deprecated.",
1246
- "default": false
1247
- },
1248
- "deprecationReason": {
1249
- "type": "string",
1250
- "description": "Human-readable reason for deprecation."
1251
- }
1252
- },
1253
- "additionalProperties": false
1254
- },
1255
- "SecurityRequirement": {
1256
- "type": "array",
1257
- "description": "Alternative set of named security schemes applied to an operation.",
1258
- "items": {
1259
- "$ref": "./common.schema.json#/$defs/Identifier"
1260
- }
1261
- },
1262
- "Header": {
1263
- "type": "object",
1264
- "required": [
1265
- "name"
1266
- ],
1267
- "properties": {
1268
- "name": {
1269
- "type": "string",
1270
- "description": "Header name (case-insensitive)."
1271
- },
1272
- "description": {
1273
- "type": "string",
1274
- "description": "Human-readable description of the header."
1275
- },
1276
- "required": {
1277
- "type": "boolean",
1278
- "description": "Whether this header is required.",
1279
- "default": false
1280
- },
1281
- "defaultValue": {
1282
- "type": "string",
1283
- "description": "Default value for the header."
1284
- }
1285
- },
1286
- "additionalProperties": false
1287
- },
1288
- "Operation": {
1289
- "type": "object",
1290
- "required": [
1291
- "name"
1292
- ],
1293
- "properties": {
1294
- "name": {
1295
- "$ref": "./common.schema.json#/$defs/Identifier"
1296
- },
1297
- "description": {
1298
- "$ref": "./common.schema.json#/$defs/Description"
1299
- },
1300
- "tags": {
1301
- "type": "array",
1302
- "description": "Tags for grouping operations.",
1303
- "items": {
1304
- "$ref": "./common.schema.json#/$defs/Tag"
1305
- }
1306
- },
1307
- "deprecated": {
1308
- "type": "boolean",
1309
- "description": "Marks the operation as deprecated.",
1310
- "default": false
1311
- },
1312
- "deprecationReason": {
1313
- "type": "string",
1314
- "description": "Human-readable reason for deprecation."
1315
- },
1316
- "args": {
1317
- "type": "array",
1318
- "description": "Arguments for this GraphQL operation.",
1319
- "items": {
1320
- "$ref": "#/$defs/Argument"
1321
- }
1322
- },
1323
- "returnType": {
1324
- "type": "string",
1325
- "description": "GraphQL return type (e.g., 'User!', '[User]')."
1326
- },
1327
- "headers": {
1328
- "type": "array",
1329
- "description": "HTTP headers relevant for this operation.",
1330
- "items": {
1331
- "$ref": "#/$defs/Header"
1332
- }
1333
- },
1334
- "security": {
1335
- "type": "array",
1336
- "description": "Security requirements for this operation. Each item represents an alternative set of named security schemes.",
1337
- "items": {
1338
- "$ref": "#/$defs/SecurityRequirement"
1339
- }
1340
- }
1341
- },
1342
- "additionalProperties": false
1343
- }
1344
- },
1345
- "properties": {
1346
- "url": {
1347
- "type": "string",
1348
- "description": "Optional path or URL of the GraphQL endpoint. Recommended: relative path (e.g. '/graphql'). Absolute URLs are allowed only if the service is tightly bound to a single host. If omitted, tooling may assume a framework default (commonly '/graphql')."
1349
- },
1350
- "schema": {
1351
- "type": "string",
1352
- "description": "GraphQL schema SDL as a string. Canonical source of type definitions."
1353
- },
1354
- "securitySchemes": {
1355
- "type": "object",
1356
- "description": "Authentication mechanisms available for this GraphQL surface.",
1357
- "additionalProperties": {
1358
- "type": "object",
1359
- "description": "Security scheme definition (shape is intentionally flexible and may evolve).",
1360
- "additionalProperties": true
1361
- }
1362
- },
1363
- "headers": {
1364
- "type": "array",
1365
- "description": "HTTP headers commonly used for GraphQL requests.",
1366
- "items": {
1367
- "$ref": "#/$defs/Header"
1368
- }
1369
- },
1370
- "queries": {
1371
- "type": "array",
1372
- "description": "Query operations exposed by the GraphQL API.",
1373
- "items": {
1374
- "$ref": "#/$defs/Operation"
1375
- }
1376
- },
1377
- "mutations": {
1378
- "type": "array",
1379
- "description": "Mutation operations exposed by the GraphQL API.",
1380
- "items": {
1381
- "$ref": "#/$defs/Operation"
1382
- }
1383
- },
1384
- "subscriptions": {
1385
- "type": "array",
1386
- "description": "Subscription operations exposed by the GraphQL API.",
1387
- "items": {
1388
- "$ref": "#/$defs/Operation"
1389
- }
1390
- }
1391
- },
1392
- "additionalProperties": false
1393
- },
1394
- {
1395
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1396
- "$id": "https://unispec.dev/schema/types/rest.schema.json",
1397
- "title": "REST API surface",
1398
- "type": "object",
1399
- "$defs": {
1400
- "Route": {
1401
- "type": "object",
1402
- "required": [
1403
- "path",
1404
- "method"
1405
- ],
1406
- "properties": {
1407
- "name": {
1408
- "$ref": "./common.schema.json#/$defs/Identifier"
1409
- },
1410
- "summary": {
1411
- "type": "string",
1412
- "description": "Short, human-readable summary of the route."
1413
- },
1414
- "tags": {
1415
- "type": "array",
1416
- "description": "Tags for grouping operations.",
1417
- "items": {
1418
- "$ref": "./common.schema.json#/$defs/Tag"
1419
- }
1420
- },
1421
- "deprecated": {
1422
- "type": "boolean",
1423
- "description": "Marks the route as deprecated.",
1424
- "default": false
1425
- },
1426
- "deprecationReason": {
1427
- "type": "string",
1428
- "description": "Human-readable reason for deprecation."
1429
- },
1430
- "description": {
1431
- "$ref": "./common.schema.json#/$defs/Description"
1432
- },
1433
- "path": {
1434
- "type": "string",
1435
- "description": "URL path template, e.g. /users/{id}."
1436
- },
1437
- "method": {
1438
- "type": "string",
1439
- "description": "HTTP method in upper-case.",
1440
- "enum": [
1441
- "GET",
1442
- "POST",
1443
- "PUT",
1444
- "PATCH",
1445
- "DELETE"
1446
- ]
1447
- },
1448
- "pathParams": {
1449
- "type": "array",
1450
- "description": "Path parameters bound from the URL template.",
1451
- "items": {
1452
- "$ref": "#/$defs/Parameter"
1453
- }
1454
- },
1455
- "queryParams": {
1456
- "type": "array",
1457
- "description": "Query string parameters.",
1458
- "items": {
1459
- "$ref": "#/$defs/Parameter"
1460
- }
1461
- },
1462
- "headers": {
1463
- "type": "array",
1464
- "description": "HTTP headers relevant for this route.",
1465
- "items": {
1466
- "$ref": "#/$defs/Parameter"
1467
- }
1468
- },
1469
- "requestBody": {
1470
- "$ref": "#/$defs/RequestBody"
1471
- },
1472
- "responses": {
1473
- "type": "object",
1474
- "description": "HTTP responses keyed by status code (e.g. '200', '404').",
1475
- "additionalProperties": {
1476
- "$ref": "#/$defs/Response"
1477
- }
1478
- },
1479
- "security": {
1480
- "type": "array",
1481
- "description": "Security requirements for this route. Each item represents an alternative set of named security schemes.",
1482
- "items": {
1483
- "$ref": "#/$defs/SecurityRequirement"
1484
- }
1485
- }
1486
- },
1487
- "additionalProperties": false
1488
- },
1489
- "SecurityRequirement": {
1490
- "type": "array",
1491
- "description": "Alternative set of named security schemes applied to an operation.",
1492
- "items": {
1493
- "$ref": "./common.schema.json#/$defs/Identifier"
1494
- }
1495
- },
1496
- "Parameter": {
1497
- "type": "object",
1498
- "required": [
1499
- "name"
1500
- ],
1501
- "properties": {
1502
- "name": {
1503
- "type": "string",
1504
- "description": "Parameter name as it appears in the API."
1505
- },
1506
- "description": {
1507
- "$ref": "./common.schema.json#/$defs/Description"
1508
- },
1509
- "required": {
1510
- "type": "boolean",
1511
- "description": "Whether this parameter is required.",
1512
- "default": false
1513
- },
1514
- "schemaRef": {
1515
- "type": "string",
1516
- "description": "Reference to a reusable schema defined in service.schemas. Recommended format: <SchemaName> (where SchemaName is a key in service.schemas). Tools may also accept a JSON Pointer in the form #/service/schemas/<SchemaName>."
1517
- }
1518
- },
1519
- "additionalProperties": false
1520
- },
1521
- "MediaType": {
1522
- "type": "object",
1523
- "properties": {
1524
- "schemaRef": {
1525
- "type": "string",
1526
- "description": "Reference to a reusable schema defined in service.schemas used as the content payload. Recommended format: <SchemaName> (where SchemaName is a key in service.schemas). Tools may also accept a JSON Pointer in the form #/service/schemas/<SchemaName>."
1527
- }
1528
- },
1529
- "additionalProperties": false
1530
- },
1531
- "Content": {
1532
- "type": "object",
1533
- "description": "Content keyed by media type, e.g. 'application/json'.",
1534
- "additionalProperties": {
1535
- "$ref": "#/$defs/MediaType"
1536
- }
1537
- },
1538
- "RequestBody": {
1539
- "type": "object",
1540
- "properties": {
1541
- "description": {
1542
- "$ref": "./common.schema.json#/$defs/Description"
1543
- },
1544
- "required": {
1545
- "type": "boolean",
1546
- "description": "Whether a request body is required.",
1547
- "default": false
1548
- },
1549
- "content": {
1550
- "$ref": "#/$defs/Content"
1551
- }
1552
- },
1553
- "additionalProperties": false
1554
- },
1555
- "Response": {
1556
- "type": "object",
1557
- "properties": {
1558
- "description": {
1559
- "$ref": "./common.schema.json#/$defs/Description"
1560
- },
1561
- "headers": {
1562
- "type": "array",
1563
- "description": "HTTP headers returned in this response.",
1564
- "items": {
1565
- "$ref": "#/$defs/ResponseHeader"
1566
- }
1567
- },
1568
- "content": {
1569
- "$ref": "#/$defs/Content"
1570
- }
1571
- },
1572
- "additionalProperties": false
1573
- },
1574
- "ResponseHeader": {
1575
- "type": "object",
1576
- "required": [
1577
- "name"
1578
- ],
1579
- "properties": {
1580
- "name": {
1581
- "type": "string",
1582
- "description": "Header name (case-insensitive)."
1583
- },
1584
- "description": {
1585
- "type": "string",
1586
- "description": "Human-readable description of the header."
1587
- },
1588
- "required": {
1589
- "type": "boolean",
1590
- "description": "Whether this header is required in the response.",
1591
- "default": false
1592
- },
1593
- "schemaRef": {
1594
- "type": "string",
1595
- "description": "Reference to a reusable schema for header value validation. Recommended format: <SchemaName> (where SchemaName is a key in service.schemas). Tools may also accept a JSON Pointer in the form #/service/schemas/<SchemaName>."
1596
- }
1597
- },
1598
- "additionalProperties": false
1599
- }
1600
- },
1601
- "properties": {
1602
- "headers": {
1603
- "type": "array",
1604
- "description": "HTTP headers commonly used for REST requests.",
1605
- "items": {
1606
- "$ref": "#/$defs/Parameter"
1607
- }
1608
- },
1609
- "routes": {
1610
- "type": "array",
1611
- "description": "List of REST routes exposed by the service.",
1612
- "items": {
1613
- "$ref": "#/$defs/Route"
1614
- }
1615
- },
1616
- "securitySchemes": {
1617
- "type": "object",
1618
- "description": "Authentication mechanisms available for this REST surface.",
1619
- "additionalProperties": {
1620
- "type": "object",
1621
- "description": "Security scheme definition (shape is intentionally flexible and may evolve).",
1622
- "additionalProperties": true
1623
- }
1624
- }
1625
- },
1626
- "additionalProperties": false
1627
- },
1628
- {
1629
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1630
- "$id": "https://unispec.dev/schema/types/schemas.schema.json",
1631
- "title": "Reusable data schemas",
1632
- "description": "Container for reusable data model definitions (request/response bodies, messages, etc.).",
1633
- "type": "object",
1634
- "additionalProperties": {
1635
- "$ref": "#/$defs/SchemaDefinition"
1636
- },
1637
- "$defs": {
1638
- "SchemaDefinition": {
1639
- "type": "object",
1640
- "description": "Named reusable data schema definition.",
1641
- "properties": {
1642
- "description": {
1643
- "$ref": "./common.schema.json#/$defs/Description"
1644
- },
1645
- "deprecated": {
1646
- "type": "boolean",
1647
- "description": "Marks the schema as deprecated.",
1648
- "default": false
1649
- },
1650
- "deprecationReason": {
1651
- "type": "string",
1652
- "description": "Human-readable reason for deprecation."
1653
- },
1654
- "examples": {
1655
- "type": "array",
1656
- "description": "Example values for this schema.",
1657
- "items": {
1658
- "description": "Example value (any JSON value)."
1659
- }
1660
- },
1661
- "jsonSchema": {
1662
- "type": "object",
1663
- "description": "Embedded JSON Schema Draft 2020-12 definition for this type.",
1664
- "additionalProperties": true
1665
- },
1666
- "validation": {
1667
- "type": "object",
1668
- "description": "Additional validation rules for this schema.",
1669
- "properties": {
1670
- "strict": {
1671
- "type": "boolean",
1672
- "description": "Whether to apply strict validation.",
1673
- "default": false
1674
- },
1675
- "additionalProperties": {
1676
- "type": "boolean",
1677
- "description": "Whether additional properties are allowed.",
1678
- "default": true
1679
- },
1680
- "customValidators": {
1681
- "type": "array",
1682
- "items": {
1683
- "type": "object",
1684
- "properties": {
1685
- "name": {
1686
- "type": "string",
1687
- "description": "Validator name."
1688
- },
1689
- "rule": {
1690
- "type": "string",
1691
- "description": "Validation rule expression."
1692
- },
1693
- "message": {
1694
- "type": "string",
1695
- "description": "Error message for failed validation."
1696
- }
1697
- },
1698
- "required": [
1699
- "name",
1700
- "rule"
1701
- ],
1702
- "additionalProperties": false
1703
- },
1704
- "description": "Custom validation rules."
1705
- }
1706
- },
1707
- "additionalProperties": false
1708
- }
1709
- },
1710
- "required": [
1711
- "jsonSchema"
1712
- ],
1713
- "additionalProperties": false
1714
- }
1715
- }
1716
- },
1717
- {
1718
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1719
- "$id": "https://unispec.dev/schema/types/service.schema.json",
1720
- "title": "UniSpec Service",
1721
- "type": "object",
1722
- "required": [
1723
- "name"
1724
- ],
1725
- "properties": {
1726
- "name": {
1727
- "$ref": "./common.schema.json#/$defs/Identifier"
1728
- },
1729
- "description": {
1730
- "$ref": "./common.schema.json#/$defs/Description"
1731
- },
1732
- "version": {
1733
- "$ref": "./common.schema.json#/$defs/Version"
1734
- },
1735
- "tags": {
1736
- "type": "array",
1737
- "description": "Tags for grouping and categorizing the service.",
1738
- "items": {
1739
- "$ref": "./common.schema.json#/$defs/Tag"
1740
- }
1741
- },
1742
- "baseUrl": {
1743
- "$ref": "./common.schema.json#/$defs/Url",
1744
- "description": "Base URL for the service. Used as the default prefix for all protocol endpoints."
1745
- },
1746
- "contact": {
1747
- "type": "object",
1748
- "description": "Contact information for the service.",
1749
- "properties": {
1750
- "name": {
1751
- "type": "string",
1752
- "description": "Contact name."
1753
- },
1754
- "email": {
1755
- "$ref": "./common.schema.json#/$defs/Email"
1756
- },
1757
- "url": {
1758
- "$ref": "./common.schema.json#/$defs/Url"
1759
- }
1760
- },
1761
- "additionalProperties": false
1762
- },
1763
- "license": {
1764
- "type": "object",
1765
- "description": "License information for the service.",
1766
- "properties": {
1767
- "name": {
1768
- "type": "string",
1769
- "description": "License name."
1770
- },
1771
- "url": {
1772
- "$ref": "./common.schema.json#/$defs/Url"
1773
- }
1774
- },
1775
- "additionalProperties": false
1776
- },
1777
- "servers": {
1778
- "type": "array",
1779
- "description": "Alternative servers where the service is available.",
1780
- "items": {
1781
- "type": "object",
1782
- "properties": {
1783
- "url": {
1784
- "$ref": "./common.schema.json#/$defs/Url"
1785
- },
1786
- "description": {
1787
- "type": "string",
1788
- "description": "Description of the server."
1789
- }
1790
- },
1791
- "additionalProperties": false
1792
- }
1793
- },
1794
- "protocols": {
1795
- "type": "object",
1796
- "description": "Protocol-specific API surfaces exposed by this service.",
1797
- "properties": {
1798
- "rest": {
1799
- "$ref": "./rest.schema.json#"
1800
- },
1801
- "graphql": {
1802
- "$ref": "./graphql.schema.json#"
1803
- },
1804
- "websocket": {
1805
- "$ref": "./websocket.schema.json#"
1806
- }
1807
- },
1808
- "additionalProperties": false
1809
- },
1810
- "schemas": {
1811
- "$ref": "./schemas.schema.json#"
1812
- },
1813
- "securitySchemes": {
1814
- "type": "object",
1815
- "description": "Authentication mechanisms available for this service.",
1816
- "additionalProperties": {
1817
- "$ref": "./common.schema.json#/$defs/SecurityScheme"
1818
- }
1819
- },
1820
- "rateLimit": {
1821
- "type": "object",
1822
- "description": "Rate limiting configuration for the service.",
1823
- "properties": {
1824
- "requestsPerMinute": {
1825
- "type": "integer",
1826
- "minimum": 0,
1827
- "description": "Maximum requests per minute."
1828
- },
1829
- "requestsPerHour": {
1830
- "type": "integer",
1831
- "minimum": 0,
1832
- "description": "Maximum requests per hour."
1833
- },
1834
- "requestsPerDay": {
1835
- "type": "integer",
1836
- "minimum": 0,
1837
- "description": "Maximum requests per day."
1838
- },
1839
- "burstLimit": {
1840
- "type": "integer",
1841
- "minimum": 0,
1842
- "description": "Maximum burst requests allowed."
1843
- },
1844
- "perUser": {
1845
- "type": "boolean",
1846
- "description": "Whether rate limiting is applied per user.",
1847
- "default": false
1848
- },
1849
- "perApiKey": {
1850
- "type": "boolean",
1851
- "description": "Whether rate limiting is applied per API key.",
1852
- "default": false
1853
- },
1854
- "customKey": {
1855
- "type": "string",
1856
- "description": "Custom key for rate limiting (e.g., IP address, organization ID)."
1857
- }
1858
- },
1859
- "additionalProperties": false
1860
- },
1861
- "compliance": {
1862
- "type": "array",
1863
- "description": "Compliance frameworks the service adheres to.",
1864
- "items": {
1865
- "type": "string",
1866
- "enum": [
1867
- "GDPR",
1868
- "SOC2",
1869
- "HIPAA",
1870
- "PCI-DSS",
1871
- "ISO27001",
1872
- "CCPA"
1873
- ]
1874
- }
1875
- },
1876
- "dataClassification": {
1877
- "type": "string",
1878
- "description": "Data classification level for the service.",
1879
- "enum": [
1880
- "public",
1881
- "internal",
1882
- "confidential",
1883
- "restricted"
1884
- ]
1885
- }
1886
- },
1887
- "additionalProperties": false
1888
- },
1889
- {
1890
- "$schema": "https://json-schema.org/draft/2020-12/schema",
1891
- "$id": "https://unispec.dev/schema/types/websocket.schema.json",
1892
- "title": "WebSocket API surface",
1893
- "type": "object",
1894
- "$defs": {
1895
- "Message": {
1896
- "type": "object",
1897
- "required": [
1898
- "name"
1899
- ],
1900
- "properties": {
1901
- "name": {
1902
- "$ref": "./common.schema.json#/$defs/Identifier"
1903
- },
1904
- "description": {
1905
- "$ref": "./common.schema.json#/$defs/Description"
1906
- },
1907
- "direction": {
1908
- "type": "string",
1909
- "description": "Direction of message flow.",
1910
- "enum": [
1911
- "publish",
1912
- "subscribe",
1913
- "both"
1914
- ],
1915
- "default": "both"
1916
- },
1917
- "deprecated": {
1918
- "type": "boolean",
1919
- "description": "Marks the message as deprecated.",
1920
- "default": false
1921
- },
1922
- "deprecationReason": {
1923
- "type": "string",
1924
- "description": "Human-readable reason for deprecation."
1925
- },
1926
- "schemaRef": {
1927
- "type": "string",
1928
- "description": "Reference to a reusable schema describing the message payload. Recommended format: <SchemaName> (where SchemaName is a key in service.schemas). Tools may also accept a JSON Pointer in the form #/service/schemas/<SchemaName>."
1929
- }
1930
- },
1931
- "additionalProperties": false
1932
- },
1933
- "Header": {
1934
- "type": "object",
1935
- "required": [
1936
- "name"
1937
- ],
1938
- "properties": {
1939
- "name": {
1940
- "type": "string",
1941
- "description": "Header name (case-insensitive)."
1942
- },
1943
- "description": {
1944
- "type": "string",
1945
- "description": "Human-readable description of the header."
1946
- },
1947
- "required": {
1948
- "type": "boolean",
1949
- "description": "Whether this header is required.",
1950
- "default": false
1951
- },
1952
- "defaultValue": {
1953
- "type": "string",
1954
- "description": "Default value for the header."
1955
- }
1956
- },
1957
- "additionalProperties": false
1958
- },
1959
- "SecurityRequirement": {
1960
- "type": "array",
1961
- "description": "Alternative set of named security schemes applied to a WebSocket channel.",
1962
- "items": {
1963
- "$ref": "./common.schema.json#/$defs/Identifier"
1964
- }
1965
- },
1966
- "Channel": {
1967
- "type": "object",
1968
- "required": [
1969
- "name"
1970
- ],
1971
- "properties": {
1972
- "name": {
1973
- "$ref": "./common.schema.json#/$defs/Identifier"
1974
- },
1975
- "description": {
1976
- "$ref": "./common.schema.json#/$defs/Description"
1977
- },
1978
- "tags": {
1979
- "type": "array",
1980
- "description": "Tags for grouping channels.",
1981
- "items": {
1982
- "$ref": "./common.schema.json#/$defs/Tag"
1983
- }
1984
- },
1985
- "namespace": {
1986
- "type": "string",
1987
- "description": "Optional namespace for the channel (e.g. 'chat', 'notifications'). Used to group related channels and avoid name collisions."
1988
- },
1989
- "direction": {
1990
- "type": "string",
1991
- "description": "Direction of message flow on this channel.",
1992
- "enum": [
1993
- "publish",
1994
- "subscribe",
1995
- "both"
1996
- ],
1997
- "default": "both"
1998
- },
1999
- "connectionParams": {
2000
- "type": "object",
2001
- "description": "Parameters required for establishing connection to this channel.",
2002
- "additionalProperties": {
2003
- "type": "string",
2004
- "description": "Connection parameter value."
2005
- }
2006
- },
2007
- "reconnectStrategy": {
2008
- "type": "object",
2009
- "description": "Reconnection strategy for this channel.",
2010
- "properties": {
2011
- "maxAttempts": {
2012
- "type": "integer",
2013
- "description": "Maximum number of reconnection attempts.",
2014
- "minimum": 0,
2015
- "default": 5
2016
- },
2017
- "delay": {
2018
- "type": "integer",
2019
- "description": "Initial delay between reconnection attempts in milliseconds.",
2020
- "minimum": 0,
2021
- "default": 1000
2022
- },
2023
- "backoffMultiplier": {
2024
- "type": "number",
2025
- "description": "Multiplier for exponential backoff.",
2026
- "minimum": 1,
2027
- "default": 2
2028
- }
2029
- },
2030
- "additionalProperties": false
2031
- },
2032
- "headers": {
2033
- "type": "array",
2034
- "description": "HTTP headers commonly used for WebSocket connections on this channel.",
2035
- "items": {
2036
- "$ref": "#/$defs/Header"
2037
- }
2038
- },
2039
- "messages": {
2040
- "type": "array",
2041
- "description": "Messages that may be sent or received on this channel.",
2042
- "items": {
2043
- "$ref": "#/$defs/Message"
2044
- }
2045
- },
2046
- "security": {
2047
- "type": "array",
2048
- "description": "Security requirements for this channel. Each item represents an alternative set of named security schemes.",
2049
- "items": {
2050
- "$ref": "#/$defs/SecurityRequirement"
2051
- }
2052
- }
2053
- },
2054
- "additionalProperties": false
2055
- }
2056
- },
2057
- "properties": {
2058
- "headers": {
2059
- "type": "array",
2060
- "description": "HTTP headers commonly used for WebSocket connections.",
2061
- "items": {
2062
- "$ref": "#/$defs/Header"
2063
- }
2064
- },
2065
- "url": {
2066
- "type": "string",
2067
- "description": "Optional path or URL of the WebSocket endpoint. Recommended: relative path (e.g. '/ws' or '/socket.io' for Socket.IO). Absolute URLs are allowed only if the service is tightly bound to a single host. If omitted, tooling may assume a framework default (commonly '/ws' for WebSocket servers or '/socket.io' for Socket.IO)."
2068
- },
2069
- "channels": {
2070
- "type": "array",
2071
- "description": "WebSocket channels/topics exposed by the service.",
2072
- "items": {
2073
- "$ref": "#/$defs/Channel"
2074
- }
2075
- },
2076
- "securitySchemes": {
2077
- "type": "object",
2078
- "description": "Authentication mechanisms available for this WebSocket surface.",
2079
- "additionalProperties": {
2080
- "type": "object",
2081
- "description": "Security scheme definition (shape is intentionally flexible and may evolve).",
2082
- "additionalProperties": true
2083
- }
2084
- }
2085
- },
2086
- "additionalProperties": false
2087
- }
2088
- ]
2089
- };
2090
- export const SCHEMA_IDS = [
2091
- "https://unispec.dev/schema/types/common.schema.json",
2092
- "https://unispec.dev/schema/types/graphql.schema.json",
2093
- "https://unispec.dev/schema/types/rest.schema.json",
2094
- "https://unispec.dev/schema/types/schemas.schema.json",
2095
- "https://unispec.dev/schema/types/service.schema.json",
2096
- "https://unispec.dev/schema/types/websocket.schema.json"
2097
- ];