Skip to content

Commit 58f14de

Browse files
committed
spec: extract Manifest JSON Schema to schemas/v1/manifest.schema.json + minimal fixture
The manifest contract has lived as prose + an inline schema block inside spec/04-manifest.md §5 since v1.0. That made every downstream tool re-implement its own interpretation: the Hub validates server-side, the CLI bounces all decisions to the Hub, an IDE has nothing to autocomplete against, CI lint cannot validate a candidate manifest before publish. This commit lifts the inline schema into a standalone, canonical JSON Schema 2020-12 file. spec/04-manifest.md now points at the file as the source of truth for any tooling that needs to validate a manifest. Inline snippets remain for human readers. ## What landed schemas/v1/manifest.schema.json 641 lines, Draft 2020-12, $id = https://jecp.dev/schemas/v1/manifest.schema.json additionalProperties: false at every level (catches typos) Per-field descriptions ported from spec prose so the schema is self-documenting in IDEs that surface JSON Schema descriptions Captures: namespace/capability identity, endpoint, authentication, actions (with composes / pricing / input_schema / output_schema / sla / side_effects), compliance, billing, deprecation, metadata + extensions escape hatch. fixtures/manifest-minimal-valid.json The smallest object that validates. Smoke-tested with Python jsonschema.Draft202012Validator — both schema-validity and fixture-validity green. ## What this unblocks - CLI client-side `jecp provider validate <yaml>` without round- tripping to the Hub. - IDE autocomplete + inline validation in VS Code / JetBrains via the standard JSON Schema mechanism (point the editor at the $id URL). - Conformance YAMLs for /v1/providers/* can reference the schema by $id, removing prose-vs-test drift. - A future @jecpdev/sdk JecpProviderClient can generate TypeScript types from the schema instead of hand-rolling them. - CI lint on jecp-spec itself can verify every example in the manifest documentation against the schema. ## What this does NOT do - No x402 fields (usdc_payout_address, payment_methods). Those are in the AUTHORIZED_SETTLER redesign currently in flight. Until the redesign lands they live under manifest.extensions{} as extension-namespace properties. v1.1 of this schema will promote them to first-class fields. - No spec wording change beyond a pointer line. The prose schema description in §5 still reads exactly as before; the new schema is normative because it is referenced from §5, not because it replaces the prose. Verified: schema valid against Draft 2020-12 metaschema; fixture validates; one negative test (invalid namespace) rejects with the expected pattern violation.
1 parent d31e4cb commit 58f14de

3 files changed

Lines changed: 430 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"namespace": "example",
3+
"display_name": "Example Translator",
4+
"capability": "translate",
5+
"version": "1.0.0",
6+
"description": "Translate text between supported languages.",
7+
"endpoint": "https://example.com/jecp",
8+
"actions": [
9+
{
10+
"id": "translate",
11+
"name": "Translate text",
12+
"description": "Translate input text to the target language.",
13+
"pricing": {
14+
"base": "$0.005",
15+
"currency": "USDC",
16+
"model": "per_call"
17+
},
18+
"input_schema": {
19+
"type": "object",
20+
"required": ["text", "target_lang"],
21+
"properties": {
22+
"text": { "type": "string", "maxLength": 5000 },
23+
"target_lang": { "type": "string", "pattern": "^[a-z]{2}$" }
24+
}
25+
},
26+
"output_schema": {
27+
"type": "object",
28+
"properties": {
29+
"translation": { "type": "string" },
30+
"detected_lang": { "type": "string" }
31+
}
32+
},
33+
"examples": [
34+
{
35+
"input": { "text": "Hello", "target_lang": "ja" },
36+
"output": { "translation": "こんにちは", "detected_lang": "en" }
37+
}
38+
]
39+
}
40+
]
41+
}

0 commit comments

Comments
 (0)