{ "openapi": "3.1.0", "info": { "title": "Aircraft Management Engine API", "description": "HTTP contracts implemented by the Aircraft Management Engine", "contact": { "name": "Aircraft Management Engine maintainers", "url": "https://github.com/rsstdd/aircraft-api-r" }, "license": { "name": "Proprietary" }, "version": "0.1.0" }, "servers": [ { "url": "/", "description": "Current deployment origin" } ], "paths": { "/health": { "get": { "tags": [ "health" ], "summary": "Check service health", "description": "Report whether the process can serve HTTP requests.", "operationId": "health", "parameters": [ { "name": "X-Request-Id", "in": "header", "description": "Correlation identifier. Adopted when it is 1-128 visible ASCII characters sent exactly once; otherwise the service generates one.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Service is running", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } }, "400": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "The request body is larger than the perimeter accepts", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "503": { "description": "The service is at capacity, or is shutting down", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "504": { "description": "The handler did not answer within the perimeter deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/ready": { "get": { "tags": [ "health" ], "summary": "Check readiness to serve database-backed traffic", "description": "Report whether the database is reachable and answering statements.", "operationId": "ready", "parameters": [ { "name": "X-Request-Id", "in": "header", "description": "Correlation identifier. Adopted when it is 1-128 visible ASCII characters sent exactly once; otherwise the service generates one.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The database answered", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadyResponse" } } } }, "400": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "The request body is larger than the perimeter accepts", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "503": { "description": "The service is draining, is at capacity, or could not reach the database within the probe deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "504": { "description": "The handler did not answer within the perimeter deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/v1/models": { "get": { "tags": [ "catalog" ], "summary": "List models", "description": "One keyset-paginated page of models, optionally filtered to a parent family. A family slug that names no family is a 404; a family that exists with no models is a successful empty collection. The only sort is slug_asc.", "operationId": "list_models", "parameters": [ { "name": "family", "in": "query", "description": "Parent family slug. A value that is not a slug is a 400; one that names no family is a 404.", "required": false, "schema": { "type": "string" } }, { "name": "sort", "in": "query", "description": "Sort order. slug_asc is the only supported value.", "required": false, "schema": { "$ref": "#/components/schemas/ModelSort" } }, { "name": "limit", "in": "query", "description": "Rows per page. Defaults to 50; values above 200 are capped to 200. A limit of 0 is refused.", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 1 } }, { "name": "cursor", "in": "query", "description": "Opaque continuation token from a previous page's next_cursor. Clients must not construct or interpret one.", "required": false, "schema": { "type": "string" } }, { "name": "X-Request-Id", "in": "header", "description": "Correlation identifier. Adopted when it is 1-128 visible ASCII characters sent exactly once; otherwise the service generates one.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "One page of models, in slug order, with a null next_cursor on the final page", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PageResponse_ModelSummaryResponse" } } } }, "400": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "$ref": "#/components/responses/AuthenticationRequiredProblem" }, "403": { "$ref": "#/components/responses/InsufficientScopeProblem" }, "404": { "description": "The family filter names no family", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "The request body is larger than the perimeter accepts", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "$ref": "#/components/responses/RateLimitedProblem" }, "503": { "description": "The service is draining, is at capacity, or could not read the models", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "504": { "description": "The handler did not answer within the perimeter deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "security": [ { "apiCredential": [ "CATALOG_READ" ] } ] } }, "/v1/models/{model}": { "get": { "tags": [ "catalog" ], "summary": "Read one model", "description": "One model by its slug. A slug no model carries is a 404.", "operationId": "model", "parameters": [ { "name": "model", "in": "path", "description": "The model's slug. The surrogate key is not a public identifier and is never accepted here.", "required": true, "schema": { "type": "string" } }, { "name": "X-Request-Id", "in": "header", "description": "Correlation identifier. Adopted when it is 1-128 visible ASCII characters sent exactly once; otherwise the service generates one.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The model", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelDetailResponse" } } } }, "400": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "$ref": "#/components/responses/AuthenticationRequiredProblem" }, "403": { "$ref": "#/components/responses/InsufficientScopeProblem" }, "404": { "description": "No model has that slug", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "The request body is larger than the perimeter accepts", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "$ref": "#/components/responses/RateLimitedProblem" }, "503": { "description": "The service is draining, is at capacity, or could not read the model", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "504": { "description": "The handler did not answer within the perimeter deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "security": [ { "apiCredential": [ "CATALOG_READ" ] } ] } }, "/v1/reference/{catalog}": { "get": { "tags": [ "reference" ], "summary": "List a seeded reference catalog", "description": "Serve one lookup catalog's active rows in its stable order. The catalog is named by an allowlisted slug; any other value is a 404. Responses carry a strong ETag, and a matching If-None-Match is answered 304 with no body.", "operationId": "catalog", "parameters": [ { "name": "catalog", "in": "path", "description": "The catalog to read. Only the allowlisted slugs are served.", "required": true, "schema": { "type": "string", "enum": [ "unit-categories", "measurement-units", "aircraft-roles", "service-statuses", "variant-types", "landing-gear-types", "propulsion-categories", "fuel-types", "dimension-metric-types", "weight-metric-types", "performance-metric-types", "certification-authorities", "airworthiness-categories", "pilot-certificate-types", "operating-approval-types", "military-mission-types", "weapon-categories", "hardpoint-position-types", "stores-types", "currencies", "cost-item-types", "aircraft-condition-grades", "ad-types", "sb-compliance-statuses", "availability-grades", "source-types", "source-reliability-grades", "curation-flag-statuses", "curation-entity-types", "assertion-statuses", "mission-profile-types", "comparison-criterion-types", "organization-types", "org-relationship-types", "systems-categories", "equipment-provision-types" ] } }, { "name": "If-None-Match", "in": "header", "description": "Entity-tags from an earlier response. A match is answered 304.", "required": false, "schema": { "type": "string" } }, { "name": "X-Request-Id", "in": "header", "description": "Correlation identifier. Adopted when it is 1-128 visible ASCII characters sent exactly once; otherwise the service generates one.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The catalog's active rows, in its stable order", "headers": { "Cache-Control": { "schema": { "type": "string" }, "description": "private, no-cache." }, "ETag": { "schema": { "type": "string" }, "description": "Strong validator for this representation." }, "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CatalogEntryResponse" } } } } }, "304": { "description": "The client's validator matches; no body is sent", "headers": { "Cache-Control": { "schema": { "type": "string" }, "description": "private, no-cache." }, "ETag": { "schema": { "type": "string" }, "description": "Strong validator for this representation." }, "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } } }, "400": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "$ref": "#/components/responses/AuthenticationRequiredProblem" }, "403": { "$ref": "#/components/responses/InsufficientScopeProblem" }, "404": { "description": "No catalog has that name", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "The request body is larger than the perimeter accepts", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "$ref": "#/components/responses/RateLimitedProblem" }, "503": { "description": "The service is draining, is at capacity, or could not read the catalog", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "504": { "description": "The handler did not answer within the perimeter deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "security": [ { "apiCredential": [ "CATALOG_READ" ] } ] } }, "/version": { "get": { "tags": [ "health" ], "summary": "Report the running build", "description": "Report the package version and, when it was stamped in at build time, the commit.", "operationId": "version", "parameters": [ { "name": "X-Request-Id", "in": "header", "description": "Correlation identifier. Adopted when it is 1-128 visible ASCII characters sent exactly once; otherwise the service generates one.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The running build", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VersionResponse" } } } }, "400": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "413": { "description": "The request body is larger than the perimeter accepts", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "503": { "description": "The service is at capacity, or is shutting down", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "504": { "description": "The handler did not answer within the perimeter deadline", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } } }, "components": { "schemas": { "CatalogEntryResponse": { "type": "object", "description": "One lookup row on the wire.\n\n`description` is omitted when the row has none, or when the catalog's table\nhas no such column at all -- the rule the measurement representation follows,\nand deliberately the opposite of `PageResponse::next_cursor`, which is `null`\non a final page so a paging client can read the member rather than test for\nit. Nothing polls a catalog for a missing description.", "required": [ "code", "label" ], "properties": { "code": { "type": "string", "description": "The stable machine code, as `aircraft_ref.lookup_code` spells it." }, "description": { "type": [ "string", "null" ] }, "label": { "type": "string" } } }, "DecimalStringResponse": { "type": "string", "description": "A `NUMERIC` value on the wire: always a JSON string, never a JSON number.\n\nThe published `pattern` is the grammar and deliberately not the capacity:\n`DecimalString` bounds digits at what `PostgreSQL` can store, but\nrepublishing those five-digit quantifiers as a `maxLength` would put a\nstorage detail in the public contract, which the pull-request `oasdiff`\ngate would then freeze.", "pattern": "^-?[0-9]+(\\.[0-9]+)?$" }, "HealthResponse": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string" } } }, "MeasurementConditionsResponse": { "type": "object", "description": "The conditions a measurement was taken under. Present only when the source\nsupplied at least one; the domain constructor drops an empty set.", "properties": { "altitude_ft": { "$ref": "#/components/schemas/DecimalStringResponse", "description": "Pressure altitude in feet." }, "isa_deviation_c": { "$ref": "#/components/schemas/DecimalStringResponse", "description": "Deviation from ISA in degrees Celsius." }, "notes": { "type": "string" }, "power_setting": { "$ref": "#/components/schemas/PowerSettingResponse" }, "surface_type": { "$ref": "#/components/schemas/SurfaceTypeResponse" }, "weight_label": { "type": "string" }, "weight_lbs": { "$ref": "#/components/schemas/DecimalStringResponse", "description": "Aircraft weight in pounds." } } }, "MeasurementResponse": { "type": "object", "description": "One measured fact.\n\nFields are private and the type is built only through [`From`], so no caller\ncan assemble a response the domain constructor would have refused. Raw and\ncanonical units are independent members because conversion changes the unit:\na raw value in `METERS` has a canonical counterpart in `FT`.", "properties": { "canonical_unit_code": { "$ref": "#/components/schemas/UnitCodeResponse" }, "canonical_value": { "$ref": "#/components/schemas/DecimalStringResponse" }, "conditions": { "$ref": "#/components/schemas/MeasurementConditionsResponse" }, "is_canonical": { "type": "boolean", "description": "Whether this row is the one served through the canonical read model.\nAbsent for a fact table that carries no such column at all; `false` says\nonly that the row is unpublished, never why." }, "raw_unit_code": { "$ref": "#/components/schemas/UnitCodeResponse", "description": "Absent when the metric is dimensionless, which is the only reason an\napplicable unit is ever missing." }, "raw_value": { "$ref": "#/components/schemas/DecimalStringResponse" } } }, "ModelDetailResponse": { "type": "object", "description": "One model, whole.\n\nThe summary's members are repeated rather than nested or flattened, which is\nwhat `AGENTS.md` asks for in keeping HTTP DTOs explicit mappings of the\napplication types instead of structural reuse of them. `name_aliases` is\nalways present, possibly empty, because [`ModelDetail`] already collapsed a\nNULL array to an empty one and a client should not have to decide again.", "required": [ "slug", "name", "family", "name_aliases" ], "properties": { "certification_year": { "type": [ "integer", "null" ], "format": "int32" }, "description": { "type": [ "string", "null" ] }, "display_name": { "type": [ "string", "null" ] }, "family": { "type": "string" }, "first_flight_year": { "type": [ "integer", "null" ], "format": "int32" }, "generation": { "type": [ "integer", "null" ], "format": "int32" }, "name": { "type": "string" }, "name_aliases": { "type": "array", "items": { "type": "string" } }, "series": { "type": [ "string", "null" ] }, "slug": { "type": "string" } } }, "ModelSort": { "type": "string", "description": "Which order a caller asked for.\n\nA closed enum rather than a string, so `?sort=name_desc` is refused by the\nsame query deserialization that already refuses `?limit=abc` -- the `400`\nthe acceptance criteria require of an unsupported sort, with no comparison\nof this module's own.", "enum": [ "slug_asc" ] }, "ModelSummaryResponse": { "type": "object", "description": "One model as a collection row.", "required": [ "slug", "name", "family" ], "properties": { "certification_year": { "type": [ "integer", "null" ], "format": "int32" }, "display_name": { "type": [ "string", "null" ] }, "family": { "type": "string", "description": "The parent family's slug." }, "first_flight_year": { "type": [ "integer", "null" ], "format": "int32" }, "generation": { "type": [ "integer", "null" ], "format": "int32" }, "name": { "type": "string" }, "series": { "type": [ "string", "null" ] }, "slug": { "type": "string", "description": "The stable public identifier, as `aircraft_ref.slug_text` spells it." } } }, "PageResponse_ModelSummaryResponse": { "type": "object", "description": "One page on the wire.\n\n`next_cursor` is serialized as `null` on a final page rather than omitted,\nbecause the accepted decision says \"Empty and final pages return a null next\ncursor\" -- the opposite of the omit-when-absent rule the measurement\nrepresentation follows, and deliberate: a client polling for more pages\nreads the member rather than testing for its presence.", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "object", "description": "One model as a collection row.", "required": [ "slug", "name", "family" ], "properties": { "certification_year": { "type": [ "integer", "null" ], "format": "int32" }, "display_name": { "type": [ "string", "null" ] }, "family": { "type": "string", "description": "The parent family's slug." }, "first_flight_year": { "type": [ "integer", "null" ], "format": "int32" }, "generation": { "type": [ "integer", "null" ], "format": "int32" }, "name": { "type": "string" }, "series": { "type": [ "string", "null" ] }, "slug": { "type": "string", "description": "The stable public identifier, as `aircraft_ref.slug_text` spells it." } } } }, "next_cursor": { "type": [ "string", "null" ] } } }, "PowerSettingResponse": { "type": "string", "description": "The published spelling of an engine setting.\n\nThe variant names are Rust's; the `rename` values are the literals\n`chk_pm_power_setting` allows in\n`database/migrations/008_performance_metrics_conditions.sql`, which is why\nthree of them are not valid Rust identifiers.", "enum": [ "MAX_TAKEOFF", "MAX_CONTINUOUS", "MAX_CLIMB", "75_PCT", "65_PCT", "55_PCT", "BEST_POWER", "BEST_ECONOMY", "LONG_RANGE_CRUISE", "IDLE" ] }, "ProblemDetails": { "type": "object", "required": [ "type", "title", "status", "detail", "instance" ], "properties": { "detail": { "type": "string" }, "instance": { "type": "string", "description": "The specific occurrence this problem describes.\n\nRequired, because `/ready` has published one since it shipped and\n`oasdiff` fails the build on `response-property-became-optional`. A route\nnames itself with a borrowed constant, a perimeter refusal owns the path\nit refused, and `Cow` is what lets one required field be both." }, "required_scope": { "$ref": "#/components/schemas/RequiredScope", "description": "The scope required by the refused operation. Present only on an\nauthorization problem, and absent rather than null everywhere else." }, "status": { "type": "integer", "format": "int32", "minimum": 0 }, "title": { "type": "string" }, "type": { "type": "string", "description": "A URI reference identifying the problem type. Relative by design: it\nresolves against the request URL, so no environment has to agree on a\nhostname for the link to be correct." } } }, "ReadyResponse": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string" } } }, "RequiredScope": { "type": "string", "description": "The scope the caller's credential is missing.", "enum": [ "CATALOG_READ", "MILITARY_READ", "CURATION_READ", "CURATION_WRITE", "ADMIN" ] }, "SurfaceTypeResponse": { "type": "string", "description": "The published spelling of a runway surface, from `chk_pm_surface_type` in\nthe same migration.", "enum": [ "PAVED", "GRASS", "GRAVEL", "SOFT", "WATER", "CARRIER_DECK" ] }, "UnitCodeResponse": { "type": "string", "description": "A measurement-unit code on the wire, in the shape\n`aircraft_ref.lookup_code` requires of every seeded code.", "pattern": "^[A-Z][A-Z0-9_]*$" }, "VersionResponse": { "type": "object", "required": [ "version" ], "properties": { "build_commit": { "type": "string", "description": "Absent rather than null when the binary was built without a commit\nstamped in, so a deployment that cannot report one is distinguishable\nfrom one reporting an empty value." }, "version": { "type": "string" } } } }, "responses": { "AuthenticationRequiredProblem": { "description": "Authentication is required", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "The `Bearer` challenge, with no parameters." }, "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "Authentication is required to access this resource.", "instance": "/example", "status": 401, "title": "Unauthorized", "type": "/problems/authentication-required" } } } }, "ConflictProblem": { "description": "The request conflicts with current resource state", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The request conflicts with the current resource state.", "instance": "/example", "status": 409, "title": "Conflict", "type": "/problems/conflict" } } } }, "DatabaseUnavailableProblem": { "description": "The database is unavailable", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The service cannot reach its database.", "instance": "/example", "status": 503, "title": "Service Unavailable", "type": "/problems/database-unavailable" } } } }, "DeadlineExceededProblem": { "description": "The request deadline expired", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The service did not produce a response within its deadline.", "instance": "/example", "status": 504, "title": "Gateway Timeout", "type": "/problems/deadline-exceeded" } } } }, "InsufficientScopeProblem": { "description": "The credential lacks the required scope", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/ProblemDetails" }, { "type": "object", "required": [ "required_scope" ] } ] }, "example": { "detail": "The authenticated principal lacks the required scope.", "instance": "/example", "required_scope": "CATALOG_READ", "status": 403, "title": "Forbidden", "type": "/problems/insufficient-scope" } } } }, "InternalErrorProblem": { "description": "The service encountered an unexpected error", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The service encountered an unexpected error.", "instance": "/example", "status": 500, "title": "Internal Server Error", "type": "/problems/internal-error" } } } }, "MalformedInputProblem": { "description": "The request body could not be read", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The request body could not be read.", "instance": "/example", "status": 400, "title": "Bad Request", "type": "/problems/malformed-input" } } } }, "MethodNotAllowedProblem": { "description": "The request method is not allowed", "headers": { "Allow": { "schema": { "type": "string" }, "description": "Methods supported by the requested resource." }, "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The request method is not allowed for this resource.", "instance": "/example", "status": 405, "title": "Method Not Allowed", "type": "/problems/method-not-allowed" } } } }, "NotFoundProblem": { "description": "The requested resource was not found", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The requested resource was not found.", "instance": "/example", "status": 404, "title": "Not Found", "type": "/problems/not-found" } } } }, "OverloadedProblem": { "description": "The service is at capacity", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The service is at capacity and refused this request rather than queueing it.", "instance": "/example", "status": 503, "title": "Service Unavailable", "type": "/problems/overloaded" } } } }, "PayloadTooLargeProblem": { "description": "The request body is too large", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The request body is larger than this service accepts.", "instance": "/example", "status": 413, "title": "Payload Too Large", "type": "/problems/payload-too-large" } } } }, "RateLimitedProblem": { "description": "The request rate limit was exceeded", "headers": { "Retry-After": { "schema": { "type": "string" }, "description": "Seconds until the caller should retry." }, "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The request rate limit has been exceeded.", "instance": "/example", "status": 429, "title": "Too Many Requests", "type": "/problems/rate-limit-exceeded" } } } }, "ShuttingDownProblem": { "description": "The service is shutting down", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The service is shutting down and is not accepting new work.", "instance": "/example", "status": 503, "title": "Service Unavailable", "type": "/problems/shutting-down" } } } }, "ValidationFailedProblem": { "description": "The request violates the API contract", "headers": { "X-Request-Id": { "schema": { "type": "string" }, "description": "The correlation identifier for this request, echoed from the client or generated here." } }, "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" }, "example": { "detail": "The request violates the API contract.", "instance": "/example", "status": 400, "title": "Validation Failed", "type": "/problems/validation-failed" } } } } }, "securitySchemes": { "apiCredential": { "type": "http", "scheme": "bearer", "description": "An issued `ak1` API credential, presented as the bearer token." } } }, "tags": [ { "name": "health", "description": "Service health checks" }, { "name": "reference", "description": "Seeded reference catalogs" }, { "name": "catalog", "description": "Aircraft models" } ] }