openapi: "3.0.3"
info:
  title: "Mock API build fixture"
  version: "1.0.0"
  description: "The mock build recipe uses a two-table fixture so that the mock server and the seed can be shown side by side. The category reference means the mock server has to answer with an id that the seeded database also contains. The pet status enum is the field a client SDK generates a type for. The integer primary key is used on this page on purpose, to contrast with the uuid fixtures elsewhere."
paths: {}
x-domain-id: "tut_pets"
x-dialect: "postgres"
components:
  schemas:
    categories:
      type: "object"
      x-primary-key: "id"
      required: ["id", "name"]
      properties:
        id:
          type: "integer"
        name:
          type: "string"
          x-unique: true
    pets:
      type: "object"
      x-primary-key: "id"
      required: ["id", "category_id", "name", "status"]
      properties:
        id:
          type: "integer"
        category_id:
          $ref: "#/components/schemas/categories"
        name:
          type: "string"
        status:
          type: "string"
          enum: ["available", "pending", "sold"]
