{"openapi":"3.1.0","x-stoplight":{"id":"hcjpz20r5j1pq"},"info":{"title":"Schematalog","version":"1.0","contact":{"name":"Berislav Lopac","url":"https://github.com/berislavlopac/","email":"berislav@lopac.net"},"license":{"name":"MIT License","url":"https://opensource.org/license/mit/"},"description":"API for cataloguing JSON Schema specifications."},"servers":[{"url":"http://schematalog.fly.dev/api","description":"Production HTTP"},{"url":"https://schematalog.fly.dev/api","description":"Production HTTPS"},{"url":"http://localhost:3000/api","description":"Localhost"},{"url":"http://testserver/api","description":"Test server"},{"url":"http://schematalog.com/api","description":"Production HTTP com"},{"url":"https://schematalog.com/api","description":"Production HTTPS com"},{"url":"http://127.0.0.1:3000/api","description":"Localhost IP"}],"paths":{"/docs":{"get":{"operationId":"api-docs","summary":"Get API documentation","description":"Retrieves the documentation for this API.","tags":["meta"],"responses":{"200":{"description":"Display API documentation.","content":{"application/json":{"schema":{"type":"object"}},"text/html":{"schema":{"type":"string"}}}},"307":{"description":"Redirect to raw spec in case of application/json content-type."}}},"parameters":[]},"/openapi.{format}":{"get":{"summary":"Get API spec","tags":["meta"],"operationId":"get-spec","description":"Retrieve the OpenAPI spec in JSON or YAML format.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{}}},"application/yaml":{"schema":{"type":"string","format":"binary"}}}}}},"parameters":[{"schema":{"type":"string","enum":["json","yaml"]},"name":"format","in":"path","required":true,"description":"Format in which to return the spec."}]},"/schemas":{"get":{"summary":"Get all schemas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"List of found schemas.","properties":{"schemas":{"type":"array","items":{"$ref":"#/components/schemas/Schema"}}}},"examples":{"Example 1":{"value":{"schemas":[{"name":"test","version":"1.0","schema":{"type":"object","title":"title","$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"field_1":{"type":"string"}},"required":["field_1"]},"created_on":"2023-04-07T13:52:44.476922+00:00"}]}}}}}}},"operationId":"get-schemas","description":"Retrieve the latest versions of all published schemas.","tags":["json-schema"]},"post":{"summary":"Publish a schema","operationId":"publish-schema","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schema"}}}},"409":{"description":"Conflict"}},"description":"Publish a new schema version. If both the schema name and the schema version exist, returns a conflict error.","tags":["json-schema"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schema"},"examples":{"Example 1":{"value":{"type":"object","title":"title","properties":{"field_1":{"type":"string"}},"required":["field_1"]}}}}}}}},"/schemas/{schema_name}":{"parameters":[{"schema":{"type":"string"},"name":"schema_name","in":"path","required":true,"description":"Name of the schema to retrieve."}],"get":{"summary":"Get schema","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schema"},"examples":{}}}},"404":{"description":"Not Found"}},"operationId":"get-schema","description":"Retrieve the latest version of a published schema.","parameters":[{"schema":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]+$"},"in":"query","name":"version","description":"Specific version of schema to retrieve. If omitted, the latest version is retrieved."}],"tags":["json-schema"]}},"/schemas/{schema_name}/versions":{"parameters":[{"schema":{"type":"string"},"name":"schema_name","in":"path","required":true,"description":"Name of the schema to retrieve."}],"get":{"summary":"Get schema versions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"List of found schemas.","properties":{"schemas":{"type":"array","items":{"$ref":"#/components/schemas/Schema"}}}},"examples":{}}}},"404":{"description":"Not Found"}},"operationId":"get-schema-versions","description":"Retrieve all versions of a published schema.","parameters":[{"schema":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$"},"in":"query","name":"version","description":"Specific version of schema to retrieve."}],"tags":["json-schema"],"x-stoplight":{"id":"ixvml18nh2q07"}}},"/schemas/{schema_name}/versions/{version}":{"parameters":[{"schema":{"type":"string"},"name":"schema_name","in":"path","required":true,"description":"Name of the schema to retrieve."},{"schema":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$"},"name":"version","in":"path","required":true,"description":"Specific version of schema to retrieve. If omitted, the latest version is retrieved."}],"get":{"summary":"Get JSON Schema","tags":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JSONSchema"},"examples":{}}}},"404":{"description":"Not Found"}},"operationId":"get-json-schema","x-stoplight":{"id":"d2j2qwdpxxkta"},"description":"The canonical URL for the JSON Schema."}}},"tags":[{"name":"json-schema"},{"name":"meta"}],"components":{"schemas":{"Schema":{"title":"Schema","type":"object","description":"JSON Schema specification.","x-examples":{"Example 1":{"name":"test","version":"1.0","schema":{"type":"object","title":"title","properties":{"field_1":{"type":"string"}},"required":["field_1"]},"created_on":"2023-04-07T13:52:44.476922+00:00"}},"examples":[{"name":"product","version":"1.2.3","schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Product","description":"A product in the catalog","type":"object","properties":{"product_id":{"type":"integer"},"product_name":{"type":"string"},"description":{"type":"string"}},"required":["product_id","product_name"]},"created_on":"2023-10-27T13:56:02.464478+00:00"}],"properties":{"name":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$","description":"Unique name of the schema."},"version":{"type":"string","pattern":"^[0-9a-zA-Z][0-9a-zA-Z-_\\.]*$","description":"Version of the schema. It can be any string containing ASCII letters and numbers, as well as dashes, dots and underscores.","example":"1.2"},"description":{"type":"string","description":"Description of the schema."},"schema":{"$ref":"#/components/schemas/JSONSchema"},"created_on":{"type":"string","description":"Date and time when the schema version was created.","format":"date-time"}},"required":["name","version","schema"]},"JSONSchema":{"title":"JSONSchema","x-stoplight":{"id":"ovs942dbf4qud"},"type":"object","anyOf":[{"$ref":"https://json-schema.org/draft-04/schema"},{"$ref":"https://json-schema.org/draft-06/schema"},{"$ref":"https://json-schema.org/draft-07/schema"},{"$ref":"https://json-schema.org/draft/2019-09/schema"},{"$ref":"https://json-schema.org/draft/2020-12/schema"}]}}}}