openapi: "3.0.3"
info:
  title: "HR directory fixture"
  version: "1.0.0"
  description: "Two tables, one foreign key, one unique email, one non-negative salary. The salary check constraint is the cheapest measurable difference between the two outputs. A field-driven library has no way to know the cost centre belongs to the department, so it produces a department id that does not exist. The fixture is identical for both tools, which is what makes the comparison reproducible."
paths: {}
x-domain-id: "cmp_hr"
x-dialect: "postgres"
components:
  schemas:
    departments:
      type: "object"
      x-primary-key: "id"
      required: ["id", "name", "cost_center"]
      properties:
        id:
          type: "integer"
        name:
          type: "string"
          x-unique: true
        cost_center:
          type: "string"
    employees:
      type: "object"
      x-primary-key: "id"
      required: ["id", "department_id", "email", "full_name", "salary_cents"]
      properties:
        id:
          type: "integer"
        department_id:
          $ref: "#/components/schemas/departments"
        email:
          type: "string"
          format: "email"
          x-unique: true
        full_name:
          type: "string"
        salary_cents:
          type: "integer"
          minimum: 0
