Skip to content

Publish event payload schemas in the OpenAPI spec - #7

Merged
anshg1214 merged 4 commits into
mainfrom
feat/openapi-event-schemas
Nov 15, 2026
Merged

anshg1214 merged 4 commits into
mainfrom
feat/openapi-event-schemas

Conversation

@anshg1214

Copy link
Copy Markdown
Member

Publishes each event's payload schema in /openapi.json as the component <tenant>.<event_type> (e.g. listenbrainz.recording_pin), so tenants can generate payload types from the spec instead of copying schemas by hand.

  • Each schema keeps its $defs; their refs are rebased onto the component path.
  • listen's recording is retitled ListenRecording, since it differs from the other events' Recording and generators name types by title.
  • POST /v1/events still types payload as an object; its description points at the schema. Validation is unchanged.

Tests: TestEventSchemasMatchValidation checks every published schema accepts and rejects the same payloads as ingest validation.

Each schema becomes the component <tenant>.<event_type>, so tenants can
generate payload types from /openapi.json.
It differs from the other events' Recording, so generated types need a
distinct name for it.
@anshg1214
anshg1214 merged commit 755822d into main Nov 15, 2026
1 check passed
@anshg1214
anshg1214 deleted the feat/openapi-event-schemas branch November 15, 2026 06:17
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.

1 participant