Skip to content

Publish JSON Schema for discovery responses - #49

Merged
j0sh merged 1 commit into
mainfrom
ja/discovery-schema
Nov 5, 2026
Merged

j0sh merged 1 commit into
mainfrom
ja/discovery-schema

Conversation

@j0sh

@j0sh j0sh commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Publish the existing GET /discovery contract as a Draft 2020-12 JSON Schema linked from the HTTP reference. The schema describes metadata and orchestrator entries, allows runner extensions, and documents exact numeric-token handling for prices.

Add Go tests that validate real HTTP responses from the orchestrator and standalone discovery handlers for populated and empty inventories, check raw numeric preservation, and validate the documented example. Keep validator imports in test files and remove the superseded price-presence test.

Validation: go test -race ./..., go vet ./..., and go mod tidy -diff. Confirmed the validator is absent from production command dependencies.

Closes #22.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 03:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change publishing the existing discovery response contract as a JSON Schema.

No open issues 🎉

What changed in this PR

Publishes the existing GET /discovery contract as a Draft 2020-12 JSON Schema, addressing #22 without changing production response behavior.

Changes:

  • Defines metadata and orchestrator entries, allows runner extensions, and documents exact numeric-token preservation for prices.
  • Links the schema from the HTTP reference and validates its documented example.
  • Expands HTTP response tests for populated and empty inventories, replacing the older price-presence test.
File Description
orchestrator/​pricing_test.go Removes the superseded price-presence test.
orchestrator/​discovery_test.go Validates empty, off-chain, and on-chain HTTP inventories against the schema.
go.sum Records validator dependency checksums.
go.mod Adds the JSON Schema validator used by tests.
docs/​http-api.md Links the discovery schema.
docs/​discovery.schema.json Defines the extensible discovery response contract and numeric precision requirements.
discovery/​server_test.go Validates standalone HTTP responses and exact numeric-token forwarding.
discovery/​schema_test.go Tests schema acceptance, rejection, and the documented example.

Review effort: Balanced

@j0sh
j0sh temporarily deployed to docker-publish November 5, 2026 03:08 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 5, 2026 03:09 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 5, 2026 03:09 — with GitHub Actions Inactive
@j0sh
j0sh temporarily deployed to docker-publish November 5, 2026 03:09 — with GitHub Actions Inactive
@j0sh
j0sh merged commit f45d83f into main Nov 5, 2026
14 checks passed
@j0sh
j0sh deleted the ja/discovery-schema branch November 5, 2026 03:18

This branch was previously deployed

1 inactive deployment
docker-publish — 5337378b Deployed Nov 5, 2026 by j0sh via docker-pr / promote #64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish a JSON Schema for GET /discovery

2 participants