{"openapi":"3.1.0","info":{"title":"Schematalog","description":"API for cataloguing JSON Schema specifications.","version":"0.1.0"},"paths":{"/api/schemas":{"get":{"tags":["Schemas"],"summary":"Get Schemas","description":"Retrieve the latest versions of all published schemas.","operationId":"get_schemas_api_schemas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaListResponse"}}}}}},"post":{"tags":["Schemas"],"summary":"Publish Schema","description":"Publish a new schema version, returning a conflict if it already exists.","operationId":"publish_schema_api_schemas_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schemas/{schema_name}":{"get":{"tags":["Schemas"],"summary":"Get Schema","description":"Redirect to the canonical URL of the schema's latest version.\n\nA schema is only fully identified by `(name, version)`, so the name on its own\nhas no document of its own to return — it points at whichever version is latest.","operationId":"get_schema_api_schemas__schema_name__get","parameters":[{"name":"schema_name","in":"path","required":true,"schema":{"type":"string","title":"Schema Name"}}],"responses":{"302":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schemas/{schema_name}/versions":{"get":{"tags":["Schemas"],"summary":"Get Schema Versions","description":"Retrieve all versions of a published schema, newest first.","operationId":"get_schema_versions_api_schemas__schema_name__versions_get","parameters":[{"name":"schema_name","in":"path","required":true,"schema":{"type":"string","title":"Schema Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schemas/{schema_name}/versions/{version}":{"get":{"tags":["Schemas"],"summary":"Get Json Schema","description":"The canonical URL for a schema version's JSON Schema document.","operationId":"get_json_schema_api_schemas__schema_name__versions__version__get","parameters":[{"name":"schema_name","in":"path","required":true,"schema":{"type":"string","title":"Schema Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Json Schema Api Schemas  Schema Name  Versions  Version  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Schemas"],"summary":"Update Schema Metadata","description":"Update a schema version's mutable metadata (owner only).\n\nCarries `deprecated` and `successor`; immutable fields cannot be changed. An\ninternal successor that is self-referential or missing returns 422. The successor is\ntri-state (omit = leave, null = clear, value = set): only when it is present in the\nrequest body do we resolve it and carry it on the command. All error outcomes\n(404/422/401/403) are mapped centrally by the app-level handlers.","operationId":"update_schema_metadata_api_schemas__schema_name__versions__version__patch","parameters":[{"name":"schema_name","in":"path","required":true,"schema":{"type":"string","title":"Schema Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaMetadataRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SchemaListResponse":{"properties":{"schemas":{"items":{"$ref":"#/components/schemas/SchemaResponse"},"type":"array","title":"Schemas","description":"The schemas in this response."}},"type":"object","required":["schemas"],"title":"SchemaListResponse","description":"Response model for a list of schemas."},"SchemaMetadataRequest":{"properties":{"deprecated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Deprecated","description":"New deprecation flag; omit to leave it unchanged."},"successor":{"anyOf":[{"type":"string","minLength":1,"format":"uri"},{"type":"null"}],"title":"Successor","description":"URI of the version that supersedes this one; null clears it, omit to leave it unchanged."}},"additionalProperties":false,"type":"object","title":"SchemaMetadataRequest","description":"Request body for `PATCH /api/schemas/{name}/versions/{version}`.\n\nA partial update of *mutable* metadata only; omitted fields are left unchanged.\nImmutable fields (name/version/schema/publication_id) are deliberately absent and\nunknown fields are rejected, so the request cannot alter the schema's identity\nor definition."},"SchemaRequest":{"properties":{"name":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$","title":"Name","description":"Unique name of the schema."},"version":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$","title":"Version","description":"Version of the schema."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the schema."},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"The JSON Schema document."}},"type":"object","required":["name","version","schema"],"title":"SchemaRequest","description":"Request body for `POST /api/schemas`."},"SchemaResponse":{"properties":{"name":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$","title":"Name","description":"Unique name of the schema."},"version":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$","title":"Version","description":"Version of the schema."},"canonical_url":{"type":"string","title":"Canonical Url","description":"The schema's permalink — also stamped as `$id` inside `schema`."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the schema."},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"The JSON Schema document."},"publication_id":{"type":"string","format":"uuid","title":"Publication Id","description":"Opaque publication identifier; a stable cursor for pagination."},"published_on":{"type":"string","format":"date-time","title":"Published On","description":"When this version was published."},"deprecated":{"type":"boolean","title":"Deprecated","description":"Whether this version is deprecated."},"successor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Successor","description":"URI of the version that supersedes this one, if any."}},"type":"object","required":["name","version","canonical_url","schema","publication_id","published_on","deprecated"],"title":"SchemaResponse","description":"Response model for a stored schema."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"Schemas","description":"Publishing and retrieving versioned JSON Schema documents. A schema is identified by its name and version; every published version is immutable, apart from its deprecation metadata."}]}