openapi: "3.0.3"
info:
  title: "Employee test data factories"
  version: "1.0.0"
  description: "A hand-written factory usually hard-codes a department id of one, which breaks the moment a second department appears. The unique email constraint means a factory that increments only the first name collides after a few dozen rows. The generated fixture keeps the two uniqueness namespaces separate, one per table. This is the page where the comparison is between hand-written factories and generated ones rather than between two generators."
paths: {}
x-domain-id: "factories"
x-dialect: "postgres"
components:
  schemas:
    departments:
      type: "object"
      x-primary-key: "id"
      required: ["id", "name"]
      properties:
        id:
          type: "integer"
        name:
          type: "string"
          x-unique: true
    employees:
      type: "object"
      x-primary-key: "id"
      required: ["id", "department_id", "email", "full_name"]
      properties:
        id:
          type: "integer"
        department_id:
          $ref: "#/components/schemas/departments"
        email:
          type: "string"
          format: "email"
          x-unique: true
        full_name:
          type: "string"
