@unispechq/unispec-schema 0.3.1 → 0.3.4
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 +195 -166
- package/index.cjs +7 -7
- package/index.d.ts +9 -9
- package/index.mjs +9 -9
- package/package.json +8 -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 +167 -167
- package/schema/types/schemas.schema.json +25 -25
- package/schema/types/service.schema.json +39 -96
- package/schema/types/websocket.schema.json +89 -89
- package/schema/unispec-tests.schema.json +318 -318
- package/schema/unispec.schema.json +23 -23
package/README.md
CHANGED
|
@@ -1,167 +1,196 @@
|
|
|
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
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
│
|
|
27
|
-
│
|
|
28
|
-
│
|
|
29
|
-
│ ├─
|
|
30
|
-
│ ├─
|
|
31
|
-
│ ├─
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
|
|
35
|
-
│
|
|
36
|
-
|
|
37
|
-
│ ├─
|
|
38
|
-
│
|
|
39
|
-
│
|
|
40
|
-
├─
|
|
41
|
-
│ ├─
|
|
42
|
-
│
|
|
43
|
-
│
|
|
44
|
-
|
|
45
|
-
│
|
|
46
|
-
├─
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
+
- A companion test specification (UniSpec Tests) for executable test documents
|
|
16
|
+
- Versioning and compatibility rules
|
|
17
|
+
- Documented process for evolving the format over time
|
|
18
|
+
|
|
19
|
+
UniSpec powers all components of the UniSpec platform:
|
|
20
|
+
Core Engine → CLI → Framework Adapters → Registry → Portal → Enterprise extensions.
|
|
21
|
+
|
|
22
|
+
## Repository Structure
|
|
23
|
+
```pgsql
|
|
24
|
+
unispec-spec/
|
|
25
|
+
├─ schema/ # JSON Schemas defining the UniSpec format
|
|
26
|
+
│ ├─ unispec.schema.json # Core UniSpec document
|
|
27
|
+
│ ├─ unispec-tests.schema.json # UniSpec Tests document (executable test cases)
|
|
28
|
+
│ └─ types/
|
|
29
|
+
│ ├─ service.schema.json
|
|
30
|
+
│ ├─ rest.schema.json
|
|
31
|
+
│ ├─ graphql.schema.json
|
|
32
|
+
│ ├─ websocket.schema.json
|
|
33
|
+
│ ├─ schemas.schema.json
|
|
34
|
+
│ └─ common.schema.json
|
|
35
|
+
│
|
|
36
|
+
├─ examples/ # Real-world examples in YAML/JSON
|
|
37
|
+
│ ├─ simple-rest.yaml
|
|
38
|
+
│ ├─ graphql.yaml
|
|
39
|
+
│ ├─ websocket.yaml
|
|
40
|
+
│ ├─ mixed-api.yaml
|
|
41
|
+
│ ├─ rest-with-schemas.yaml # REST service using service.schemas and schemaRef
|
|
42
|
+
│ └─ rest-with-schemas.tests.yaml # UniSpec Tests for the same REST service
|
|
43
|
+
│
|
|
44
|
+
├─ reference/ # Human-readable format documentation
|
|
45
|
+
│ ├─ fields.md
|
|
46
|
+
│ ├─ components.md
|
|
47
|
+
│ ├─ versioning.md
|
|
48
|
+
│ ├─ style-guide.md
|
|
49
|
+
│ └─ tests.md # UniSpec Tests format reference
|
|
50
|
+
│
|
|
51
|
+
├─ CHANGELOG.md # Release notes for UniSpec format versions
|
|
52
|
+
└─ README.md
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Purpose of This Repository
|
|
56
|
+
|
|
57
|
+
This repo defines the UniSpec language, not its implementation.
|
|
58
|
+
|
|
59
|
+
### This repository contains:
|
|
60
|
+
|
|
61
|
+
- Format specification
|
|
62
|
+
- JSON Schemas
|
|
63
|
+
- Examples and documentation
|
|
64
|
+
- Rules for versioning and compatibility
|
|
65
|
+
- Documented process for evolving the format over time
|
|
66
|
+
|
|
67
|
+
### This repository does NOT contain:
|
|
68
|
+
|
|
69
|
+
- UniSpec Core engine
|
|
70
|
+
- CLI implementation
|
|
71
|
+
- Framework adapters
|
|
72
|
+
- Portal or Registry code
|
|
73
|
+
- Runtime logic
|
|
74
|
+
|
|
75
|
+
These live in other repositories of the UniSpec organization.
|
|
76
|
+
|
|
77
|
+
## Format Philosophy
|
|
78
|
+
|
|
79
|
+
UniSpec is built on the following principles:
|
|
80
|
+
|
|
81
|
+
1. Multi-protocol by design
|
|
82
|
+
- One format supports:
|
|
83
|
+
- REST
|
|
84
|
+
- GraphQL
|
|
85
|
+
- WebSocket
|
|
86
|
+
- (future) gRPC, AsyncAPI, message buses
|
|
87
|
+
|
|
88
|
+
2. Developer-first
|
|
89
|
+
- Readable YAML for humans, strict JSON Schema for machines.
|
|
90
|
+
|
|
91
|
+
3. Strong structure, minimal ambiguity
|
|
92
|
+
- No vague fields or implicit semantics.
|
|
93
|
+
- Every field has a precise definition and validation rules.
|
|
94
|
+
|
|
95
|
+
4. Extensible
|
|
96
|
+
- Supports custom extensions via x-extensions, similar to OpenAPI but cleaner and more consistent.
|
|
97
|
+
|
|
98
|
+
5. Transparent evolution
|
|
99
|
+
- All major changes must be clearly documented.
|
|
100
|
+
- Minor changes and clarifications must maintain backward compatibility.
|
|
101
|
+
|
|
102
|
+
## JSON Schema
|
|
103
|
+
|
|
104
|
+
The canonical, machine-readable definition of UniSpec lives in the schema/ directory.
|
|
105
|
+
|
|
106
|
+
### Rules:
|
|
107
|
+
|
|
108
|
+
- Must follow JSON Schema Draft 2020-12
|
|
109
|
+
- Must use $defs for reusable components
|
|
110
|
+
- Must clearly describe field semantics and constraints
|
|
111
|
+
- All examples must validate against the schema
|
|
112
|
+
- Breaking changes require explicit agreement and a major version bump
|
|
113
|
+
|
|
114
|
+
## Service Object
|
|
115
|
+
|
|
116
|
+
The UniSpec document describes a single `service`.
|
|
117
|
+
|
|
118
|
+
### `service` fields
|
|
119
|
+
|
|
120
|
+
- **`name`** (required) — service identifier.
|
|
121
|
+
- **`description`** (optional) — human-readable description.
|
|
122
|
+
- **`version`** (optional) — service contract version (SemVer).
|
|
123
|
+
- **`protocols`** (optional) — protocol-specific API surfaces (`rest`, `graphql`, `websocket`).
|
|
124
|
+
- **`schemas`** (optional) — reusable schemas referenced by protocol definitions.
|
|
125
|
+
|
|
126
|
+
### `schemaRef` convention
|
|
127
|
+
|
|
128
|
+
Fields named `schemaRef` reference schemas defined in `service.schemas`.
|
|
129
|
+
|
|
130
|
+
Recommended format:
|
|
131
|
+
|
|
132
|
+
- `<SchemaName>` where `SchemaName` is a key in `service.schemas`.
|
|
133
|
+
|
|
134
|
+
Tools may also accept a JSON Pointer form:
|
|
135
|
+
|
|
136
|
+
- `#/service/schemas/<SchemaName>`
|
|
137
|
+
|
|
138
|
+
## Examples
|
|
139
|
+
|
|
140
|
+
The examples/ directory contains official UniSpec examples:
|
|
141
|
+
|
|
142
|
+
- simple-rest.yaml — minimal REST service
|
|
143
|
+
- graphql.yaml — example of a GraphQL API
|
|
144
|
+
- websocket.yaml — WebSocket channels and messages
|
|
145
|
+
- mixed-api.yaml — service combining REST + GraphQL + WebSocket
|
|
146
|
+
|
|
147
|
+
All examples are validated as part of CI to ensure correctness.
|
|
148
|
+
|
|
149
|
+
## Reference Documentation
|
|
150
|
+
|
|
151
|
+
All human-readable format documentation lives in reference/:
|
|
152
|
+
|
|
153
|
+
- fields.md — detailed field-by-field description
|
|
154
|
+
- components.md — rules for schema composition and references
|
|
155
|
+
- versioning.md — semantic versioning guidelines
|
|
156
|
+
- style-guide.md — recommended naming and structuring conventions
|
|
157
|
+
|
|
158
|
+
These documents must be kept in sync with schema changes.
|
|
159
|
+
|
|
160
|
+
## Versioning
|
|
161
|
+
|
|
162
|
+
UniSpec follows Semantic Versioning (SemVer):
|
|
163
|
+
|
|
164
|
+
- MAJOR — breaking changes
|
|
165
|
+
- MINOR — new backward-compatible features
|
|
166
|
+
- PATCH — fixes, clarifications, corrections
|
|
167
|
+
|
|
168
|
+
All changes must be recorded in CHANGELOG.md.
|
|
169
|
+
|
|
170
|
+
## Format Changes and Contributions
|
|
171
|
+
|
|
172
|
+
Any change that alters:
|
|
173
|
+
|
|
174
|
+
- structure of the UniSpec format
|
|
175
|
+
- semantics of existing fields
|
|
176
|
+
- compatibility rules
|
|
177
|
+
- supported protocols
|
|
178
|
+
|
|
179
|
+
should be proposed and discussed in a pull request before being applied here.
|
|
180
|
+
|
|
181
|
+
## Contributing
|
|
182
|
+
|
|
183
|
+
Contributions are welcome!
|
|
184
|
+
|
|
185
|
+
To contribute:
|
|
186
|
+
|
|
187
|
+
1. Read the reference docs.
|
|
188
|
+
2. Discuss substantial format changes in an issue or pull request.
|
|
189
|
+
3. Submit a PR with clear explanation and schema validation.
|
|
190
|
+
|
|
191
|
+
All contributions must preserve backward compatibility unless explicitly approved otherwise.
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
This repository is open-source and free to implement.
|
|
167
196
|
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.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const unispec: Record<string, any>;
|
|
2
|
-
export const manifest: Record<string, any>;
|
|
3
|
-
|
|
4
|
-
declare const _default: {
|
|
5
|
-
unispec: typeof unispec;
|
|
6
|
-
manifest: typeof manifest;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
1
|
+
export const unispec: Record<string, any>;
|
|
2
|
+
export const manifest: Record<string, any>;
|
|
3
|
+
|
|
4
|
+
declare const _default: {
|
|
5
|
+
unispec: typeof unispec;
|
|
6
|
+
manifest: typeof manifest;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default _default;
|
package/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createRequire } from "module";
|
|
2
|
-
|
|
3
|
-
const require = createRequire(import.meta.url);
|
|
4
|
-
|
|
5
|
-
const unispec = require("./schema/unispec.schema.json");
|
|
6
|
-
const manifest = require("./schema/index.json");
|
|
7
|
-
|
|
8
|
-
export { unispec, manifest };
|
|
9
|
-
export default { unispec, manifest };
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
const unispec = require("./schema/unispec.schema.json");
|
|
6
|
+
const manifest = require("./schema/index.json");
|
|
7
|
+
|
|
8
|
+
export { unispec, manifest };
|
|
9
|
+
export default { unispec, manifest };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unispechq/unispec-schema",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Official UniSpec JSON Schemas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.cjs",
|
|
@@ -31,12 +31,19 @@
|
|
|
31
31
|
"type": "git",
|
|
32
32
|
"url": "git+https://github.com/unispec/unispec-spec.git"
|
|
33
33
|
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/unispec/unispec-spec/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/unispec/unispec-spec#readme",
|
|
34
38
|
"keywords": [
|
|
35
39
|
"unispec",
|
|
36
40
|
"api",
|
|
37
41
|
"json-schema",
|
|
38
42
|
"specification"
|
|
39
43
|
],
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
40
47
|
"publishConfig": {
|
|
41
48
|
"access": "public"
|
|
42
49
|
}
|
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
|
+
}
|