@unispechq/unispec-schema 0.1.2 → 0.1.5
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 +169 -169
- package/index.cjs +7 -7
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/schema/index.json +14 -14
- package/schema/types/common.schema.json +16 -16
- package/schema/types/graphql.schema.json +58 -58
- package/schema/types/rest.schema.json +144 -144
- package/schema/types/schemas.schema.json +25 -25
- package/schema/types/service.schema.json +36 -36
- package/schema/types/websocket.schema.json +61 -61
- package/schema/unispec.schema.json +23 -23
package/README.md
CHANGED
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
# UniSpec Specification
|
|
2
|
-
|
|
3
|
-
Official specification of the UniSpec API definition language
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
UniSpec is a modern, multi-protocol API specification format designed to unify REST, GraphQL, WebSocket, and event-driven API documentation under a single, consistent model.
|
|
8
|
-
|
|
9
|
-
This repository is the single source of truth for the UniSpec format.
|
|
10
|
-
It contains everything required to understand, validate, and evolve the language:
|
|
11
|
-
|
|
12
|
-
- Machine-readable JSON Schemas
|
|
13
|
-
- Human-readable reference documentation
|
|
14
|
-
- Official examples (REST, GraphQL, WebSocket, mixed APIs)
|
|
15
|
-
- Versioning and compatibility rules
|
|
16
|
-
- Links to RFCs governing format evolution
|
|
17
|
-
|
|
18
|
-
UniSpec powers all components of the UniSpec platform:
|
|
19
|
-
Core Engine → CLI → Framework Adapters → Registry → Portal → Enterprise extensions.
|
|
20
|
-
|
|
21
|
-
## Repository Structure
|
|
22
|
-
```pgsql
|
|
23
|
-
unispec-spec/
|
|
24
|
-
├─ schema/ # JSON Schemas defining the UniSpec format
|
|
25
|
-
│ ├─ unispec.schema.json
|
|
26
|
-
│ └─ types/
|
|
27
|
-
│ ├─ service.schema.json
|
|
28
|
-
│ ├─ rest.schema.json
|
|
29
|
-
│ ├─ graphql.schema.json
|
|
30
|
-
│ ├─ websocket.schema.json
|
|
31
|
-
│ ├─ schemas.schema.json
|
|
32
|
-
│ └─ common.schema.json
|
|
33
|
-
│
|
|
34
|
-
├─ examples/ # Real-world examples in YAML/JSON
|
|
35
|
-
│ ├─ simple-rest.yaml
|
|
36
|
-
│ ├─ graphql.yaml
|
|
37
|
-
│ ├─ websocket.yaml
|
|
38
|
-
│ └─ mixed-api.yaml
|
|
39
|
-
│
|
|
40
|
-
├─ reference/ # Human-readable format documentation
|
|
41
|
-
│ ├─ fields.md
|
|
42
|
-
│ ├─ components.md
|
|
43
|
-
│ ├─ versioning.md
|
|
44
|
-
│ └─ style-guide.md
|
|
45
|
-
│
|
|
46
|
-
├─ CHANGELOG.md # Release notes for UniSpec format versions
|
|
47
|
-
└─ README.md
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Purpose of This Repository
|
|
51
|
-
|
|
52
|
-
This repo defines the UniSpec language, not its implementation.
|
|
53
|
-
|
|
54
|
-
### This repository contains:
|
|
55
|
-
|
|
56
|
-
- Format specification
|
|
57
|
-
- JSON Schemas
|
|
58
|
-
- Examples and documentation
|
|
59
|
-
- Rules for versioning and compatibility
|
|
60
|
-
- Official reference for implementers
|
|
61
|
-
|
|
62
|
-
### This repository does NOT contain:
|
|
63
|
-
|
|
64
|
-
- UniSpec Core engine
|
|
65
|
-
- CLI implementation
|
|
66
|
-
- Framework adapters
|
|
67
|
-
- Portal or Registry code
|
|
68
|
-
- Runtime logic
|
|
69
|
-
|
|
70
|
-
These live in other repositories of the UniSpec organization.
|
|
71
|
-
|
|
72
|
-
## Format Philosophy
|
|
73
|
-
|
|
74
|
-
UniSpec is built on the following principles:
|
|
75
|
-
|
|
76
|
-
1. Multi-protocol by design
|
|
77
|
-
- One format supports:
|
|
78
|
-
- REST
|
|
79
|
-
- GraphQL
|
|
80
|
-
- WebSocket
|
|
81
|
-
- (future) gRPC, AsyncAPI, message buses
|
|
82
|
-
|
|
83
|
-
2. Developer-first
|
|
84
|
-
- Readable YAML for humans, strict JSON Schema for machines.
|
|
85
|
-
|
|
86
|
-
3. Strong structure, minimal ambiguity
|
|
87
|
-
- No vague fields or implicit semantics.
|
|
88
|
-
- Every field has a precise definition and validation rules.
|
|
89
|
-
|
|
90
|
-
4. Extensible
|
|
91
|
-
- Supports custom extensions via x-extensions, similar to OpenAPI but cleaner and more consistent.
|
|
92
|
-
|
|
93
|
-
5. Transparent evolution
|
|
94
|
-
- All major changes require an approved RFC.
|
|
95
|
-
- Minor changes and clarifications must maintain backward compatibility.
|
|
96
|
-
|
|
97
|
-
## JSON Schema
|
|
98
|
-
|
|
99
|
-
The canonical, machine-readable definition of UniSpec lives in the schema/ directory.
|
|
100
|
-
|
|
101
|
-
### Rules:
|
|
102
|
-
|
|
103
|
-
- Must follow JSON Schema Draft 2020-12
|
|
104
|
-
- Must use $defs for reusable components
|
|
105
|
-
- Must clearly describe field semantics and constraints
|
|
106
|
-
- All examples must validate against the schema
|
|
107
|
-
- Breaking changes require an RFC and a major version bump
|
|
108
|
-
|
|
109
|
-
## Examples
|
|
110
|
-
|
|
111
|
-
The examples/ directory contains official UniSpec examples:
|
|
112
|
-
|
|
113
|
-
- simple-rest.yaml — minimal REST service
|
|
114
|
-
- graphql.yaml — example of a GraphQL API
|
|
115
|
-
- websocket.yaml — WebSocket channels and messages
|
|
116
|
-
- mixed-api.yaml — service combining REST + GraphQL + WebSocket
|
|
117
|
-
|
|
118
|
-
All examples are validated as part of CI to ensure correctness.
|
|
119
|
-
|
|
120
|
-
## Reference Documentation
|
|
121
|
-
|
|
122
|
-
All human-readable format documentation lives in reference/:
|
|
123
|
-
|
|
124
|
-
- fields.md — detailed field-by-field description
|
|
125
|
-
- components.md — rules for schema composition and references
|
|
126
|
-
- versioning.md — semantic versioning guidelines
|
|
127
|
-
- style-guide.md — recommended naming and structuring conventions
|
|
128
|
-
|
|
129
|
-
These documents must be kept in sync with schema changes.
|
|
130
|
-
|
|
131
|
-
## Versioning
|
|
132
|
-
|
|
133
|
-
UniSpec follows Semantic Versioning (SemVer):
|
|
134
|
-
|
|
135
|
-
- MAJOR — breaking changes
|
|
136
|
-
- MINOR — new backward-compatible features
|
|
137
|
-
- PATCH — fixes, clarifications, corrections
|
|
138
|
-
|
|
139
|
-
All changes must be recorded in CHANGELOG.md.
|
|
140
|
-
|
|
141
|
-
## RFC Process
|
|
142
|
-
|
|
143
|
-
Any change that alters:
|
|
144
|
-
|
|
145
|
-
- structure of the UniSpec format
|
|
146
|
-
- semantics of existing fields
|
|
147
|
-
- compatibility rules
|
|
148
|
-
- supported protocols
|
|
149
|
-
|
|
150
|
-
must be proposed, discussed, and approved in the
|
|
151
|
-
unispec-rfcs repository before being applied here.
|
|
152
|
-
|
|
153
|
-
No schema modifications may occur without a corresponding approved RFC.
|
|
154
|
-
|
|
155
|
-
## Contributing
|
|
156
|
-
|
|
157
|
-
Contributions are welcome!
|
|
158
|
-
|
|
159
|
-
To contribute:
|
|
160
|
-
|
|
161
|
-
1. Read the reference docs.
|
|
162
|
-
2. Review open RFCs or create a new proposal.
|
|
163
|
-
3. Submit a PR with clear explanation and schema validation.
|
|
164
|
-
|
|
165
|
-
All contributions must preserve backward compatibility unless explicitly approved otherwise.
|
|
166
|
-
|
|
167
|
-
## License
|
|
168
|
-
|
|
169
|
-
This repository is open-source and free to implement.
|
|
1
|
+
# UniSpec Specification
|
|
2
|
+
|
|
3
|
+
Official specification of the UniSpec API definition language
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
UniSpec is a modern, multi-protocol API specification format designed to unify REST, GraphQL, WebSocket, and event-driven API documentation under a single, consistent model.
|
|
8
|
+
|
|
9
|
+
This repository is the single source of truth for the UniSpec format.
|
|
10
|
+
It contains everything required to understand, validate, and evolve the language:
|
|
11
|
+
|
|
12
|
+
- Machine-readable JSON Schemas
|
|
13
|
+
- Human-readable reference documentation
|
|
14
|
+
- Official examples (REST, GraphQL, WebSocket, mixed APIs)
|
|
15
|
+
- Versioning and compatibility rules
|
|
16
|
+
- Links to RFCs governing format evolution
|
|
17
|
+
|
|
18
|
+
UniSpec powers all components of the UniSpec platform:
|
|
19
|
+
Core Engine → CLI → Framework Adapters → Registry → Portal → Enterprise extensions.
|
|
20
|
+
|
|
21
|
+
## Repository Structure
|
|
22
|
+
```pgsql
|
|
23
|
+
unispec-spec/
|
|
24
|
+
├─ schema/ # JSON Schemas defining the UniSpec format
|
|
25
|
+
│ ├─ unispec.schema.json
|
|
26
|
+
│ └─ types/
|
|
27
|
+
│ ├─ service.schema.json
|
|
28
|
+
│ ├─ rest.schema.json
|
|
29
|
+
│ ├─ graphql.schema.json
|
|
30
|
+
│ ├─ websocket.schema.json
|
|
31
|
+
│ ├─ schemas.schema.json
|
|
32
|
+
│ └─ common.schema.json
|
|
33
|
+
│
|
|
34
|
+
├─ examples/ # Real-world examples in YAML/JSON
|
|
35
|
+
│ ├─ simple-rest.yaml
|
|
36
|
+
│ ├─ graphql.yaml
|
|
37
|
+
│ ├─ websocket.yaml
|
|
38
|
+
│ └─ mixed-api.yaml
|
|
39
|
+
│
|
|
40
|
+
├─ reference/ # Human-readable format documentation
|
|
41
|
+
│ ├─ fields.md
|
|
42
|
+
│ ├─ components.md
|
|
43
|
+
│ ├─ versioning.md
|
|
44
|
+
│ └─ style-guide.md
|
|
45
|
+
│
|
|
46
|
+
├─ CHANGELOG.md # Release notes for UniSpec format versions
|
|
47
|
+
└─ README.md
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Purpose of This Repository
|
|
51
|
+
|
|
52
|
+
This repo defines the UniSpec language, not its implementation.
|
|
53
|
+
|
|
54
|
+
### This repository contains:
|
|
55
|
+
|
|
56
|
+
- Format specification
|
|
57
|
+
- JSON Schemas
|
|
58
|
+
- Examples and documentation
|
|
59
|
+
- Rules for versioning and compatibility
|
|
60
|
+
- Official reference for implementers
|
|
61
|
+
|
|
62
|
+
### This repository does NOT contain:
|
|
63
|
+
|
|
64
|
+
- UniSpec Core engine
|
|
65
|
+
- CLI implementation
|
|
66
|
+
- Framework adapters
|
|
67
|
+
- Portal or Registry code
|
|
68
|
+
- Runtime logic
|
|
69
|
+
|
|
70
|
+
These live in other repositories of the UniSpec organization.
|
|
71
|
+
|
|
72
|
+
## Format Philosophy
|
|
73
|
+
|
|
74
|
+
UniSpec is built on the following principles:
|
|
75
|
+
|
|
76
|
+
1. Multi-protocol by design
|
|
77
|
+
- One format supports:
|
|
78
|
+
- REST
|
|
79
|
+
- GraphQL
|
|
80
|
+
- WebSocket
|
|
81
|
+
- (future) gRPC, AsyncAPI, message buses
|
|
82
|
+
|
|
83
|
+
2. Developer-first
|
|
84
|
+
- Readable YAML for humans, strict JSON Schema for machines.
|
|
85
|
+
|
|
86
|
+
3. Strong structure, minimal ambiguity
|
|
87
|
+
- No vague fields or implicit semantics.
|
|
88
|
+
- Every field has a precise definition and validation rules.
|
|
89
|
+
|
|
90
|
+
4. Extensible
|
|
91
|
+
- Supports custom extensions via x-extensions, similar to OpenAPI but cleaner and more consistent.
|
|
92
|
+
|
|
93
|
+
5. Transparent evolution
|
|
94
|
+
- All major changes require an approved RFC.
|
|
95
|
+
- Minor changes and clarifications must maintain backward compatibility.
|
|
96
|
+
|
|
97
|
+
## JSON Schema
|
|
98
|
+
|
|
99
|
+
The canonical, machine-readable definition of UniSpec lives in the schema/ directory.
|
|
100
|
+
|
|
101
|
+
### Rules:
|
|
102
|
+
|
|
103
|
+
- Must follow JSON Schema Draft 2020-12
|
|
104
|
+
- Must use $defs for reusable components
|
|
105
|
+
- Must clearly describe field semantics and constraints
|
|
106
|
+
- All examples must validate against the schema
|
|
107
|
+
- Breaking changes require an RFC and a major version bump
|
|
108
|
+
|
|
109
|
+
## Examples
|
|
110
|
+
|
|
111
|
+
The examples/ directory contains official UniSpec examples:
|
|
112
|
+
|
|
113
|
+
- simple-rest.yaml — minimal REST service
|
|
114
|
+
- graphql.yaml — example of a GraphQL API
|
|
115
|
+
- websocket.yaml — WebSocket channels and messages
|
|
116
|
+
- mixed-api.yaml — service combining REST + GraphQL + WebSocket
|
|
117
|
+
|
|
118
|
+
All examples are validated as part of CI to ensure correctness.
|
|
119
|
+
|
|
120
|
+
## Reference Documentation
|
|
121
|
+
|
|
122
|
+
All human-readable format documentation lives in reference/:
|
|
123
|
+
|
|
124
|
+
- fields.md — detailed field-by-field description
|
|
125
|
+
- components.md — rules for schema composition and references
|
|
126
|
+
- versioning.md — semantic versioning guidelines
|
|
127
|
+
- style-guide.md — recommended naming and structuring conventions
|
|
128
|
+
|
|
129
|
+
These documents must be kept in sync with schema changes.
|
|
130
|
+
|
|
131
|
+
## Versioning
|
|
132
|
+
|
|
133
|
+
UniSpec follows Semantic Versioning (SemVer):
|
|
134
|
+
|
|
135
|
+
- MAJOR — breaking changes
|
|
136
|
+
- MINOR — new backward-compatible features
|
|
137
|
+
- PATCH — fixes, clarifications, corrections
|
|
138
|
+
|
|
139
|
+
All changes must be recorded in CHANGELOG.md.
|
|
140
|
+
|
|
141
|
+
## RFC Process
|
|
142
|
+
|
|
143
|
+
Any change that alters:
|
|
144
|
+
|
|
145
|
+
- structure of the UniSpec format
|
|
146
|
+
- semantics of existing fields
|
|
147
|
+
- compatibility rules
|
|
148
|
+
- supported protocols
|
|
149
|
+
|
|
150
|
+
must be proposed, discussed, and approved in the
|
|
151
|
+
unispec-rfcs repository before being applied here.
|
|
152
|
+
|
|
153
|
+
No schema modifications may occur without a corresponding approved RFC.
|
|
154
|
+
|
|
155
|
+
## Contributing
|
|
156
|
+
|
|
157
|
+
Contributions are welcome!
|
|
158
|
+
|
|
159
|
+
To contribute:
|
|
160
|
+
|
|
161
|
+
1. Read the reference docs.
|
|
162
|
+
2. Review open RFCs or create a new proposal.
|
|
163
|
+
3. Submit a PR with clear explanation and schema validation.
|
|
164
|
+
|
|
165
|
+
All contributions must preserve backward compatibility unless explicitly approved otherwise.
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
This repository is open-source and free to implement.
|
|
170
170
|
The UniSpec format is designed to be an open standard.
|
package/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const unispec = require("./schema/unispec.schema.json");
|
|
2
|
-
const manifest = require("./schema/index.json");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
unispec,
|
|
6
|
-
manifest,
|
|
7
|
-
};
|
|
1
|
+
const unispec = require("./schema/unispec.schema.json");
|
|
2
|
+
const manifest = require("./schema/index.json");
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
unispec,
|
|
6
|
+
manifest,
|
|
7
|
+
};
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import unispec from "./schema/unispec.schema.json" assert { type: "json" };
|
|
2
|
-
import manifest from "./schema/index.json" assert { type: "json" };
|
|
3
|
-
|
|
4
|
-
export { unispec, manifest };
|
|
5
|
-
export default { unispec, manifest };
|
|
1
|
+
import unispec from "./schema/unispec.schema.json" assert { type: "json" };
|
|
2
|
+
import manifest from "./schema/index.json" assert { type: "json" };
|
|
3
|
+
|
|
4
|
+
export { unispec, manifest };
|
|
5
|
+
export default { unispec, manifest };
|
package/package.json
CHANGED
package/schema/index.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"name": "@unispechq/unispec-schema",
|
|
4
|
-
"description": "Official UniSpec JSON Schemas",
|
|
5
|
-
"root": "./unispec.schema.json",
|
|
6
|
-
"types": {
|
|
7
|
-
"common": "./types/common.schema.json",
|
|
8
|
-
"graphql": "./types/graphql.schema.json",
|
|
9
|
-
"rest": "./types/rest.schema.json",
|
|
10
|
-
"schemas": "./types/schemas.schema.json",
|
|
11
|
-
"service": "./types/service.schema.json",
|
|
12
|
-
"websocket": "./types/websocket.schema.json"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"name": "@unispechq/unispec-schema",
|
|
4
|
+
"description": "Official UniSpec JSON Schemas",
|
|
5
|
+
"root": "./unispec.schema.json",
|
|
6
|
+
"types": {
|
|
7
|
+
"common": "./types/common.schema.json",
|
|
8
|
+
"graphql": "./types/graphql.schema.json",
|
|
9
|
+
"rest": "./types/rest.schema.json",
|
|
10
|
+
"schemas": "./types/schemas.schema.json",
|
|
11
|
+
"service": "./types/service.schema.json",
|
|
12
|
+
"websocket": "./types/websocket.schema.json"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/types/common.schema.json",
|
|
4
|
-
"title": "Common UniSpec definitions",
|
|
5
|
-
"$defs": {
|
|
6
|
-
"Identifier": {
|
|
7
|
-
"type": "string",
|
|
8
|
-
"description": "Identifier for services, operations, channels, etc.",
|
|
9
|
-
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
|
|
10
|
-
},
|
|
11
|
-
"Description": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "Human-readable description text."
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/common.schema.json",
|
|
4
|
+
"title": "Common UniSpec definitions",
|
|
5
|
+
"$defs": {
|
|
6
|
+
"Identifier": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Identifier for services, operations, channels, etc.",
|
|
9
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
|
|
10
|
+
},
|
|
11
|
+
"Description": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Human-readable description text."
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/types/graphql.schema.json",
|
|
4
|
-
"title": "GraphQL API surface",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"$defs": {
|
|
7
|
-
"Operation": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"required": ["name"],
|
|
10
|
-
"properties": {
|
|
11
|
-
"name": {
|
|
12
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
-
},
|
|
14
|
-
"description": {
|
|
15
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
16
|
-
},
|
|
17
|
-
"deprecated": {
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"description": "Marks the operation as deprecated.",
|
|
20
|
-
"default": false
|
|
21
|
-
},
|
|
22
|
-
"deprecationReason": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"description": "Human-readable reason for deprecation."
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"additionalProperties": false
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"properties": {
|
|
31
|
-
"schema": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "GraphQL schema SDL as a string. Canonical source of type definitions."
|
|
34
|
-
},
|
|
35
|
-
"queries": {
|
|
36
|
-
"type": "array",
|
|
37
|
-
"description": "Query operations exposed by the GraphQL API.",
|
|
38
|
-
"items": {
|
|
39
|
-
"$ref": "#/$defs/Operation"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"mutations": {
|
|
43
|
-
"type": "array",
|
|
44
|
-
"description": "Mutation operations exposed by the GraphQL API.",
|
|
45
|
-
"items": {
|
|
46
|
-
"$ref": "#/$defs/Operation"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"subscriptions": {
|
|
50
|
-
"type": "array",
|
|
51
|
-
"description": "Subscription operations exposed by the GraphQL API.",
|
|
52
|
-
"items": {
|
|
53
|
-
"$ref": "#/$defs/Operation"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"additionalProperties": false
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/graphql.schema.json",
|
|
4
|
+
"title": "GraphQL API surface",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"Operation": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["name"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"name": {
|
|
12
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
+
},
|
|
14
|
+
"description": {
|
|
15
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
16
|
+
},
|
|
17
|
+
"deprecated": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Marks the operation as deprecated.",
|
|
20
|
+
"default": false
|
|
21
|
+
},
|
|
22
|
+
"deprecationReason": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Human-readable reason for deprecation."
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"properties": {
|
|
31
|
+
"schema": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "GraphQL schema SDL as a string. Canonical source of type definitions."
|
|
34
|
+
},
|
|
35
|
+
"queries": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"description": "Query operations exposed by the GraphQL API.",
|
|
38
|
+
"items": {
|
|
39
|
+
"$ref": "#/$defs/Operation"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"mutations": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"description": "Mutation operations exposed by the GraphQL API.",
|
|
45
|
+
"items": {
|
|
46
|
+
"$ref": "#/$defs/Operation"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"subscriptions": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"description": "Subscription operations exposed by the GraphQL API.",
|
|
52
|
+
"items": {
|
|
53
|
+
"$ref": "#/$defs/Operation"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
}
|
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/types/rest.schema.json",
|
|
4
|
-
"title": "REST API surface",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"$defs": {
|
|
7
|
-
"Route": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"required": ["path", "method"],
|
|
10
|
-
"properties": {
|
|
11
|
-
"name": {
|
|
12
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
-
},
|
|
14
|
-
"summary": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"description": "Short, human-readable summary of the route."
|
|
17
|
-
},
|
|
18
|
-
"description": {
|
|
19
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
20
|
-
},
|
|
21
|
-
"path": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"description": "URL path template, e.g. /users/{id}."
|
|
24
|
-
},
|
|
25
|
-
"method": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "HTTP method in upper-case.",
|
|
28
|
-
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]
|
|
29
|
-
},
|
|
30
|
-
"pathParams": {
|
|
31
|
-
"type": "array",
|
|
32
|
-
"description": "Path parameters bound from the URL template.",
|
|
33
|
-
"items": {
|
|
34
|
-
"$ref": "#/$defs/Parameter"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"queryParams": {
|
|
38
|
-
"type": "array",
|
|
39
|
-
"description": "Query string parameters.",
|
|
40
|
-
"items": {
|
|
41
|
-
"$ref": "#/$defs/Parameter"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"headers": {
|
|
45
|
-
"type": "array",
|
|
46
|
-
"description": "HTTP headers relevant for this route.",
|
|
47
|
-
"items": {
|
|
48
|
-
"$ref": "#/$defs/Parameter"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"requestBody": {
|
|
52
|
-
"$ref": "#/$defs/RequestBody"
|
|
53
|
-
},
|
|
54
|
-
"responses": {
|
|
55
|
-
"type": "object",
|
|
56
|
-
"description": "HTTP responses keyed by status code (e.g. '200', '404').",
|
|
57
|
-
"additionalProperties": {
|
|
58
|
-
"$ref": "#/$defs/Response"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"additionalProperties": false
|
|
63
|
-
},
|
|
64
|
-
"Parameter": {
|
|
65
|
-
"type": "object",
|
|
66
|
-
"required": ["name"],
|
|
67
|
-
"properties": {
|
|
68
|
-
"name": {
|
|
69
|
-
"type": "string",
|
|
70
|
-
"description": "Parameter name as it appears in the API."
|
|
71
|
-
},
|
|
72
|
-
"description": {
|
|
73
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
74
|
-
},
|
|
75
|
-
"required": {
|
|
76
|
-
"type": "boolean",
|
|
77
|
-
"description": "Whether this parameter is required.",
|
|
78
|
-
"default": false
|
|
79
|
-
},
|
|
80
|
-
"schemaRef": {
|
|
81
|
-
"type": "string",
|
|
82
|
-
"description": "Reference to a reusable schema defined in the service-level schemas section."
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"additionalProperties": false
|
|
86
|
-
},
|
|
87
|
-
"MediaType": {
|
|
88
|
-
"type": "object",
|
|
89
|
-
"properties": {
|
|
90
|
-
"schemaRef": {
|
|
91
|
-
"type": "string",
|
|
92
|
-
"description": "Reference to a reusable schema used as the content payload."
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"additionalProperties": false
|
|
96
|
-
},
|
|
97
|
-
"Content": {
|
|
98
|
-
"type": "object",
|
|
99
|
-
"description": "Content keyed by media type, e.g. 'application/json'.",
|
|
100
|
-
"additionalProperties": {
|
|
101
|
-
"$ref": "#/$defs/MediaType"
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
"RequestBody": {
|
|
105
|
-
"type": "object",
|
|
106
|
-
"properties": {
|
|
107
|
-
"description": {
|
|
108
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
109
|
-
},
|
|
110
|
-
"required": {
|
|
111
|
-
"type": "boolean",
|
|
112
|
-
"description": "Whether a request body is required.",
|
|
113
|
-
"default": false
|
|
114
|
-
},
|
|
115
|
-
"content": {
|
|
116
|
-
"$ref": "#/$defs/Content"
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
"additionalProperties": false
|
|
120
|
-
},
|
|
121
|
-
"Response": {
|
|
122
|
-
"type": "object",
|
|
123
|
-
"properties": {
|
|
124
|
-
"description": {
|
|
125
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
126
|
-
},
|
|
127
|
-
"content": {
|
|
128
|
-
"$ref": "#/$defs/Content"
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"additionalProperties": false
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"properties": {
|
|
135
|
-
"routes": {
|
|
136
|
-
"type": "array",
|
|
137
|
-
"description": "List of REST routes exposed by the service.",
|
|
138
|
-
"items": {
|
|
139
|
-
"$ref": "#/$defs/Route"
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
"additionalProperties": false
|
|
144
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/rest.schema.json",
|
|
4
|
+
"title": "REST API surface",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"Route": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["path", "method"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"name": {
|
|
12
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
+
},
|
|
14
|
+
"summary": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Short, human-readable summary of the route."
|
|
17
|
+
},
|
|
18
|
+
"description": {
|
|
19
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
20
|
+
},
|
|
21
|
+
"path": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "URL path template, e.g. /users/{id}."
|
|
24
|
+
},
|
|
25
|
+
"method": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "HTTP method in upper-case.",
|
|
28
|
+
"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]
|
|
29
|
+
},
|
|
30
|
+
"pathParams": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"description": "Path parameters bound from the URL template.",
|
|
33
|
+
"items": {
|
|
34
|
+
"$ref": "#/$defs/Parameter"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"queryParams": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"description": "Query string parameters.",
|
|
40
|
+
"items": {
|
|
41
|
+
"$ref": "#/$defs/Parameter"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"headers": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"description": "HTTP headers relevant for this route.",
|
|
47
|
+
"items": {
|
|
48
|
+
"$ref": "#/$defs/Parameter"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"requestBody": {
|
|
52
|
+
"$ref": "#/$defs/RequestBody"
|
|
53
|
+
},
|
|
54
|
+
"responses": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"description": "HTTP responses keyed by status code (e.g. '200', '404').",
|
|
57
|
+
"additionalProperties": {
|
|
58
|
+
"$ref": "#/$defs/Response"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"additionalProperties": false
|
|
63
|
+
},
|
|
64
|
+
"Parameter": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"required": ["name"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"name": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Parameter name as it appears in the API."
|
|
71
|
+
},
|
|
72
|
+
"description": {
|
|
73
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
74
|
+
},
|
|
75
|
+
"required": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"description": "Whether this parameter is required.",
|
|
78
|
+
"default": false
|
|
79
|
+
},
|
|
80
|
+
"schemaRef": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "Reference to a reusable schema defined in the service-level schemas section."
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"additionalProperties": false
|
|
86
|
+
},
|
|
87
|
+
"MediaType": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"properties": {
|
|
90
|
+
"schemaRef": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Reference to a reusable schema used as the content payload."
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"additionalProperties": false
|
|
96
|
+
},
|
|
97
|
+
"Content": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"description": "Content keyed by media type, e.g. 'application/json'.",
|
|
100
|
+
"additionalProperties": {
|
|
101
|
+
"$ref": "#/$defs/MediaType"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"RequestBody": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"description": {
|
|
108
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
109
|
+
},
|
|
110
|
+
"required": {
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"description": "Whether a request body is required.",
|
|
113
|
+
"default": false
|
|
114
|
+
},
|
|
115
|
+
"content": {
|
|
116
|
+
"$ref": "#/$defs/Content"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
},
|
|
121
|
+
"Response": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"properties": {
|
|
124
|
+
"description": {
|
|
125
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
126
|
+
},
|
|
127
|
+
"content": {
|
|
128
|
+
"$ref": "#/$defs/Content"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"additionalProperties": false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"properties": {
|
|
135
|
+
"routes": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"description": "List of REST routes exposed by the service.",
|
|
138
|
+
"items": {
|
|
139
|
+
"$ref": "#/$defs/Route"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"additionalProperties": false
|
|
144
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/types/schemas.schema.json",
|
|
4
|
-
"title": "Reusable data schemas",
|
|
5
|
-
"description": "Container for reusable data model definitions (request/response bodies, messages, etc.).",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": {
|
|
8
|
-
"$ref": "#/$defs/SchemaDefinition"
|
|
9
|
-
},
|
|
10
|
-
"$defs": {
|
|
11
|
-
"SchemaDefinition": {
|
|
12
|
-
"type": "object",
|
|
13
|
-
"description": "Named reusable data schema definition.",
|
|
14
|
-
"properties": {
|
|
15
|
-
"jsonSchema": {
|
|
16
|
-
"type": "object",
|
|
17
|
-
"description": "Embedded JSON Schema Draft 2020-12 definition for this type.",
|
|
18
|
-
"additionalProperties": true
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"required": ["jsonSchema"],
|
|
22
|
-
"additionalProperties": false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/schemas.schema.json",
|
|
4
|
+
"title": "Reusable data schemas",
|
|
5
|
+
"description": "Container for reusable data model definitions (request/response bodies, messages, etc.).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": {
|
|
8
|
+
"$ref": "#/$defs/SchemaDefinition"
|
|
9
|
+
},
|
|
10
|
+
"$defs": {
|
|
11
|
+
"SchemaDefinition": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "Named reusable data schema definition.",
|
|
14
|
+
"properties": {
|
|
15
|
+
"jsonSchema": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"description": "Embedded JSON Schema Draft 2020-12 definition for this type.",
|
|
18
|
+
"additionalProperties": true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["jsonSchema"],
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
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
|
-
"title": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "Short human-friendly service title."
|
|
14
|
-
},
|
|
15
|
-
"description": {
|
|
16
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
17
|
-
},
|
|
18
|
-
"protocols": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"description": "Protocol-specific API surfaces exposed by this service.",
|
|
21
|
-
"properties": {
|
|
22
|
-
"rest": {
|
|
23
|
-
"$ref": "./rest.schema.json#"
|
|
24
|
-
},
|
|
25
|
-
"graphql": {
|
|
26
|
-
"$ref": "./graphql.schema.json#"
|
|
27
|
-
},
|
|
28
|
-
"websocket": {
|
|
29
|
-
"$ref": "./websocket.schema.json#"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"additionalProperties": false
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"additionalProperties": false
|
|
36
|
-
}
|
|
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
|
+
"title": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Short human-friendly service title."
|
|
14
|
+
},
|
|
15
|
+
"description": {
|
|
16
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
17
|
+
},
|
|
18
|
+
"protocols": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"description": "Protocol-specific API surfaces exposed by this service.",
|
|
21
|
+
"properties": {
|
|
22
|
+
"rest": {
|
|
23
|
+
"$ref": "./rest.schema.json#"
|
|
24
|
+
},
|
|
25
|
+
"graphql": {
|
|
26
|
+
"$ref": "./graphql.schema.json#"
|
|
27
|
+
},
|
|
28
|
+
"websocket": {
|
|
29
|
+
"$ref": "./websocket.schema.json#"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"additionalProperties": false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
}
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/types/websocket.schema.json",
|
|
4
|
-
"title": "WebSocket API surface",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"$defs": {
|
|
7
|
-
"Message": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"required": ["name"],
|
|
10
|
-
"properties": {
|
|
11
|
-
"name": {
|
|
12
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
-
},
|
|
14
|
-
"description": {
|
|
15
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
16
|
-
},
|
|
17
|
-
"schemaRef": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "Reference to a reusable schema describing the message payload."
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"additionalProperties": false
|
|
23
|
-
},
|
|
24
|
-
"Channel": {
|
|
25
|
-
"type": "object",
|
|
26
|
-
"required": ["name"],
|
|
27
|
-
"properties": {
|
|
28
|
-
"name": {
|
|
29
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
30
|
-
},
|
|
31
|
-
"description": {
|
|
32
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
33
|
-
},
|
|
34
|
-
"direction": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"description": "Direction of message flow on this channel.",
|
|
37
|
-
"enum": ["publish", "subscribe", "both"],
|
|
38
|
-
"default": "both"
|
|
39
|
-
},
|
|
40
|
-
"messages": {
|
|
41
|
-
"type": "array",
|
|
42
|
-
"description": "Messages that may be sent or received on this channel.",
|
|
43
|
-
"items": {
|
|
44
|
-
"$ref": "#/$defs/Message"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"additionalProperties": false
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"properties": {
|
|
52
|
-
"channels": {
|
|
53
|
-
"type": "array",
|
|
54
|
-
"description": "WebSocket channels/topics exposed by the service.",
|
|
55
|
-
"items": {
|
|
56
|
-
"$ref": "#/$defs/Channel"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"additionalProperties": false
|
|
61
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/websocket.schema.json",
|
|
4
|
+
"title": "WebSocket API surface",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"Message": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["name"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"name": {
|
|
12
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
+
},
|
|
14
|
+
"description": {
|
|
15
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
16
|
+
},
|
|
17
|
+
"schemaRef": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Reference to a reusable schema describing the message payload."
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
},
|
|
24
|
+
"Channel": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": ["name"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"name": {
|
|
29
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
30
|
+
},
|
|
31
|
+
"description": {
|
|
32
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
33
|
+
},
|
|
34
|
+
"direction": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Direction of message flow on this channel.",
|
|
37
|
+
"enum": ["publish", "subscribe", "both"],
|
|
38
|
+
"default": "both"
|
|
39
|
+
},
|
|
40
|
+
"messages": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"description": "Messages that may be sent or received on this channel.",
|
|
43
|
+
"items": {
|
|
44
|
+
"$ref": "#/$defs/Message"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"additionalProperties": false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"properties": {
|
|
52
|
+
"channels": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"description": "WebSocket channels/topics exposed by the service.",
|
|
55
|
+
"items": {
|
|
56
|
+
"$ref": "#/$defs/Channel"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"additionalProperties": false
|
|
61
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/unispec.schema.json",
|
|
4
|
-
"title": "UniSpec document",
|
|
5
|
-
"description": "Top-level UniSpec document describing a multi-protocol API service.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"required": ["unispecVersion", "service"],
|
|
8
|
-
"properties": {
|
|
9
|
-
"unispecVersion": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "UniSpec format version (SemVer)."
|
|
12
|
-
},
|
|
13
|
-
"service": {
|
|
14
|
-
"$ref": "./types/service.schema.json#"
|
|
15
|
-
},
|
|
16
|
-
"extensions": {
|
|
17
|
-
"type": "object",
|
|
18
|
-
"description": "Custom vendor-specific extensions (x-*) at the document root.",
|
|
19
|
-
"additionalProperties": true
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"additionalProperties": false
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/unispec.schema.json",
|
|
4
|
+
"title": "UniSpec document",
|
|
5
|
+
"description": "Top-level UniSpec document describing a multi-protocol API service.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["unispecVersion", "service"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"unispecVersion": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "UniSpec format version (SemVer)."
|
|
12
|
+
},
|
|
13
|
+
"service": {
|
|
14
|
+
"$ref": "./types/service.schema.json#"
|
|
15
|
+
},
|
|
16
|
+
"extensions": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"description": "Custom vendor-specific extensions (x-*) at the document root.",
|
|
19
|
+
"additionalProperties": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|