Skip to content

Commit 284c9f4

Browse files
committed
Rename the discovery endpoints field to descriptor and move the schema id to vdprotocol.org
The endpoints map in /.well-known/vdp pointed at view descriptor resources through a field named "template"; it is now "descriptor", with the DiscoveryDocument schema definition updated to match. Schema $id and $ref examples now use vdprotocol.org instead of vdp.dev.
1 parent 6271a8e commit 284c9f4

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

‎docs/schema.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The VDP JSON Schema defines the structure of view descriptor documents. It uses
99
```json
1010
{
1111
"$schema": "http://json-schema.org/draft-07/schema#",
12-
"$id": "https://vdp.dev/schemas/vdp.v0-1.schema.json",
12+
"$id": "https://vdprotocol.org/schemas/vdp.v0-1.schema.json",
1313
"title": "View Descriptor Protocol (VDP) v0.1",
1414
"description": "Schema for VDP view descriptor documents. Validates standalone ViewDescriptor and MultiViewDescriptor payloads. Definitions in $defs can be referenced by other schemas for inline body transport (_view / _views).",
1515

@@ -89,9 +89,18 @@ The VDP JSON Schema defines the structure of view descriptor documents. It uses
8989
},
9090
"endpoints": {
9191
"type": "object",
92-
"description": "A map of API endpoint paths to their default view descriptors.",
92+
"description": "A map of API endpoint paths to the URL of each endpoint's view descriptor resource.",
9393
"additionalProperties": {
94-
"$ref": "#/$defs/ViewDescriptor"
94+
"type": "object",
95+
"properties": {
96+
"descriptor": {
97+
"type": "string",
98+
"format": "uri",
99+
"description": "URL of the view descriptor resource for this endpoint."
100+
}
101+
},
102+
"required": ["descriptor"],
103+
"additionalProperties": false
95104
}
96105
},
97106
"trustedTemplateDomains": {
@@ -152,7 +161,7 @@ Served at `/.well-known/vdp` for API discovery.
152161
| Property | Type | Required | Description |
153162
|----------|------|----------|-------------|
154163
| `version` | `string` | Yes | VDP specification version |
155-
| `endpoints` | `object` | No | Map of API paths to their default view descriptors |
164+
| `endpoints` | `object` | No | Map of API paths to `{ "descriptor": <url> }` entries pointing at each endpoint's view descriptor resource |
156165
| `trustedTemplateDomains` | `string[]` | No | Allowlist of base URLs for template loading |
157166

158167
## Validation
@@ -162,7 +171,7 @@ The schema validates standalone VDP documents (view descriptor JSON files). For
162171
```json
163172
{
164173
"properties": {
165-
"_view": { "$ref": "https://vdp.dev/schemas/vdp.v0-1.schema.json#/$defs/ViewDescriptor" }
174+
"_view": { "$ref": "https://vdprotocol.org/schemas/vdp.v0-1.schema.json#/$defs/ViewDescriptor" }
166175
}
167176
}
168177
```

‎docs/specification.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,10 +627,10 @@ Content-Type: application/vdp+json
627627
"version": "0.1",
628628
"endpoints": {
629629
"/api/dashboard": {
630-
"template": "https://example.com/views/dashboard.json"
630+
"descriptor": "https://example.com/views/dashboard.json"
631631
},
632632
"/api/products": {
633-
"template": "https://example.com/views/product-list.json"
633+
"descriptor": "https://example.com/views/product-list.json"
634634
}
635635
},
636636
"trustedTemplateDomains": [
@@ -639,7 +639,7 @@ Content-Type: application/vdp+json
639639
}
640640
```
641641

642-
This allows clients to prefetch view descriptors and preload templates before making data requests. The `trustedTemplateDomains` field provides the template URL allowlist referenced in Section 10.
642+
Each entry in `endpoints` maps an API path to the URL of its view descriptor resource (`descriptor`). This allows clients to prefetch view descriptors and preload templates before making data requests. The `trustedTemplateDomains` field provides the template URL allowlist referenced in Section 10.
643643

644644
### 13.3 OpenAPI Extension
645645

0 commit comments

Comments
 (0)