openapi: 3.0.3
info:
  title: Ref@ire Lachèvre
  version: "1.0"
servers:
  - url: https://recueils17.othone.org/api
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
security:
  - ApiKeyAuth: []
paths:
  /health:
    get:
      summary: Healthcheck
      responses:
        "200": { description: OK }
  /pieces:
    get:
      summary: Lister les pièces avec contexte auteur/recueil
      parameters:
        - in: query; name: forme; schema: { type: string }
        - in: query; name: auteur; schema: { type: string, description: "id numérique ou substring du nom" }
        - in: query; name: recueil; schema: { type: string, description: "id numérique ou substring du titre" }
        - in: query; name: limit; schema: { type: integer, default: 100, minimum: 1, maximum: 1000 }
        - in: query; name: offset; schema: { type: integer, default: 0, minimum: 0 }
      responses:
        "200": { description: OK }
  /auteurs:
    get:
      summary: Lister les auteurs
      parameters:
        - in: query; name: q; schema: { type: string, description: "recherche dans le nom" }
        - in: query; name: limit; schema: { type: integer, default: 100, minimum: 1, maximum: 1000 }
        - in: query; name: offset; schema: { type: integer, default: 0, minimum: 0 }
      responses:
        "200": { description: OK }
  /recueils:
    get:
      summary: Lister les recueils
      parameters:
        - in: query; name: annee; schema: { type: integer }
        - in: query; name: ville; schema: { type: string }
        - in: query; name: q; schema: { type: string, description: "recherche sur le titre" }
        - in: query; name: limit; schema: { type: integer, default: 100, minimum: 1, maximum: 1000 }
        - in: query; name: offset; schema: { type: integer, default: 0, minimum: 0 }
      responses:
        "200": { description: OK }