openapi: "3.0.3"
info:
  title: "Token issuing API"
  version: "1.0.0"
  description: "The expires_in constraint rejects zero, which is the exact value a generator that misses the keyword produces. A stub server can return a token body, but only the seeded table can answer which scopes a client is allowed to request. The redirect_uri column is a URI and a generator that emits a bare path produces a value the validation layer rejects. Two tables are enough to show the difference between a stub response and a referentially consistent fixture."
paths: {}
x-domain-id: "alt_sessions"
x-dialect: "postgres"
components:
  schemas:
    clients:
      type: "object"
      x-primary-key: "id"
      required: ["id", "name", "redirect_uri"]
      properties:
        id:
          type: "string"
          format: "uuid"
        name:
          type: "string"
          x-unique: true
        redirect_uri:
          type: "string"
          format: "uri"
    tokens:
      type: "object"
      x-primary-key: "id"
      required: ["id", "client_id", "scope", "expires_in"]
      properties:
        id:
          type: "string"
          format: "uuid"
        client_id:
          $ref: "#/components/schemas/clients"
        scope:
          type: "string"
        expires_in:
          type: "integer"
          minimum: 1
