openapi: "3.0.3"
info:
  title: "Product fixture for a fixture-generation walkthrough"
  version: "1.0.0"
  description: "The walkthrough uses this fixture because two tables are enough to show a foreign key and still fit in a single committed file. The product slug is unique, so the generator has to append a suffix rather than repeat a row. The variant price is non-negative, which gives the first negative case a clear expected failure. The status enum has two members here on purpose, because the walkthrough is about the pipeline rather than the schema richness."
paths: {}
x-domain-id: "tut_products"
x-dialect: "postgres"
components:
  schemas:
    products:
      type: "object"
      x-primary-key: "id"
      required: ["id", "slug", "title", "status"]
      properties:
        id:
          type: "string"
          format: "uuid"
        slug:
          type: "string"
          x-unique: true
        title:
          type: "string"
        status:
          type: "string"
          enum: ["draft", "active"]
    variants:
      type: "object"
      x-primary-key: "id"
      required: ["id", "product_id", "sku", "price_cents"]
      properties:
        id:
          type: "string"
          format: "uuid"
        product_id:
          $ref: "#/components/schemas/products"
        sku:
          type: "string"
          x-unique: true
        price_cents:
          type: "integer"
          minimum: 0
