openapi: 3.1.0
info:
  title: Antara / FLEXIA API
  version: 0.1.0
  description: >
    Contrato unificado. Acciones legacy `?action=` mapean a paths documentados;
    respuesta estándar JSON con Request-Id en cabecera.
servers:
  - url: https://example.test/services/php/public
paths:
  /index.php:
    get:
      summary: Health / ping
      operationId: ping
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiEnvelope"
components:
  schemas:
    ApiError:
      type: object
      required: [code, message]
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    ApiEnvelope:
      type: object
      required: [ok]
      properties:
        ok:
          type: boolean
        data:
          nullable: true
        error:
          $ref: "#/components/schemas/ApiError"
