@unispechq/unispec-schema 0.3.3 → 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 CHANGED
@@ -111,6 +111,30 @@ The canonical, machine-readable definition of UniSpec lives in the schema/ direc
111
111
  - All examples must validate against the schema
112
112
  - Breaking changes require explicit agreement and a major version bump
113
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
+
114
138
  ## Examples
115
139
 
116
140
  The examples/ directory contains official UniSpec examples:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unispechq/unispec-schema",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Official UniSpec JSON Schemas",
5
5
  "type": "module",
6
6
  "main": "index.cjs",
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "schemaRef": {
95
95
  "type": "string",
96
- "description": "Reference to a reusable schema defined in the service-level schemas section."
96
+ "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>."
97
97
  }
98
98
  },
99
99
  "additionalProperties": false
@@ -103,7 +103,7 @@
103
103
  "properties": {
104
104
  "schemaRef": {
105
105
  "type": "string",
106
- "description": "Reference to a reusable schema used as the content payload."
106
+ "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>."
107
107
  }
108
108
  },
109
109
  "additionalProperties": false
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "schemaRef": {
18
18
  "type": "string",
19
- "description": "Reference to a reusable schema describing the message payload."
19
+ "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>."
20
20
  }
21
21
  },
22
22
  "additionalProperties": false
@@ -205,7 +205,7 @@
205
205
  },
206
206
  "schemaRef": {
207
207
  "type": "string",
208
- "description": "Reference to a schema from service.schemas for schemaOnly mode."
208
+ "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>."
209
209
  }
210
210
  },
211
211
  "additionalProperties": false