{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "NowToPrint Marketplace Problem Type Registry",
    "version": "1.0.0",
    "description": "Discoverable RFC 9457 problem type definitions for Marketplace clients. This bounded document describes the public problem-type registry endpoint; Marketplace business route payloads remain governed by their route and package contracts.",
    "x-contract-scope": "problem-type-registry-only",
    "x-full-marketplace-route-payload-contract": false
  },
  "servers": [
    {
      "url": "https://nowtoprint.com",
      "description": "Canonical public type-URI origin"
    }
  ],
  "paths": {
    "/problems/marketplace/{slug}": {
      "get": {
        "operationId": "getMarketplaceProblemTypeDefinition",
        "summary": "Resolve a Marketplace RFC 9457 problem type",
        "description": "Returns the stable definition associated with a Marketplace problem type URI. The response is cacheable public contract metadata and never contains tenant or request data.",
        "tags": [
          "Marketplace contract registry"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Stable Marketplace problem type slug.",
            "schema": {
              "type": "string",
              "enum": [
                "invalid-request",
                "validation-failed",
                "unauthenticated",
                "forbidden",
                "not-found",
                "conflict",
                "precondition-required",
                "too-early",
                "payload-too-large",
                "length-required",
                "gone",
                "unsupported-media-type",
                "revision-conflict",
                "idempotency-conflict",
                "rate-limited",
                "unavailable",
                "bad-gateway",
                "gateway-timeout",
                "internal-error"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stable Marketplace problem type definition.",
            "headers": {
              "Cache-Control": {
                "description": "Public registry cache policy.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceProblemTypeDefinition"
                }
              }
            }
          },
          "404": {
            "description": "The slug is not part of the closed registry.",
            "headers": {
              "Cache-Control": {
                "description": "Unknown types are never cached.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnknownProblemType"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MarketplaceProblemDetails": {
        "$ref": "./marketplace-problem-details.v1.schema.json"
      },
      "MarketplaceProblemTypeDefinition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "title",
          "status",
          "code",
          "registryVersion",
          "mediaType",
          "schema"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://nowtoprint\\.com/problems/marketplace/"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "code": {
            "$ref": "./marketplace-problem-details.v1.schema.json#/properties/code"
          },
          "registryVersion": {
            "const": "marketplace-problem-registry-v1"
          },
          "mediaType": {
            "const": "application/problem+json"
          },
          "schema": {
            "const": "/docs/api/marketplace-problem-details.v1.schema.json"
          }
        }
      },
      "UnknownProblemType": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "const": "Unknown Marketplace problem type."
          }
        }
      }
    }
  }
}
