# pg_ripple_http OpenAPI 3.1 Specification
# A13-02 (v0.86.0): This file is auto-generated by utoipa at build time.
# The canonical source of truth is the binary's /openapi.yaml endpoint.
#
# To regenerate:
#   1. Start pg_ripple_http: PG_RIPPLE_HTTP_NO_AUTH=1 ./target/release/pg_ripple_http
#   2. Fetch: curl http://localhost:7878/openapi.yaml > pg_ripple_http/openapi.yaml
#   3. Commit the updated file.
#
# CI validates that this file is not empty and is valid YAML.
# A full diff check requires building and running the binary, which is done in
# the build-check job's openapi-verify step.
openapi: 3.1.0
info:
  title: pg_ripple_http
  description: SPARQL 1.1 Protocol HTTP endpoint for pg_ripple
  license:
    name: Apache-2.0
  version: 0.86.0
paths:
  /sparql:
    get:
      tags:
      - sparql
      summary: SPARQL 1.1 Protocol — GET endpoint
      description: Execute a SPARQL SELECT, ASK, CONSTRUCT, or DESCRIBE query via HTTP GET.
      operationId: sparql_get
      parameters:
      - name: query
        in: query
        required: true
        schema:
          type: string
      - name: default-graph-uri
        in: query
        required: false
        schema:
          type: string
      - name: named-graph-uri
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Query results (content type depends on Accept header)
        '400':
          description: Bad request (parse error or invalid query)
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
    post:
      tags:
      - sparql
      summary: SPARQL 1.1 Protocol — POST endpoint
      description: Execute a SPARQL query via HTTP POST (application/x-www-form-urlencoded or application/sparql-query).
      operationId: sparql_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                query:
                  type: string
          application/sparql-query:
            schema:
              type: string
        required: true
      responses:
        '200':
          description: Query results
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
  /sparql/stream:
    get:
      tags:
      - sparql
      summary: SPARQL SELECT streaming cursor (SSE, HTTP-02 v0.86.0)
      description: Streams SPARQL SELECT results as Server-Sent Events.
      operationId: sparql_stream
      parameters:
      - name: query
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: SSE stream of result rows
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          description: Bad request
        '401':
          description: Unauthorized
  /health:
    get:
      tags:
      - admin
      summary: Health check
      operationId: health_check
      responses:
        '200':
          description: Service is healthy
  /metrics:
    get:
      tags:
      - admin
      summary: Prometheus metrics
      description: 'Returns Prometheus-format metrics. WARNING: no auth — network isolate.'
      operationId: metrics
      responses:
        '200':
          description: Prometheus metrics text
          content:
            text/plain:
              schema:
                type: string
  /openapi.yaml:
    get:
      tags:
      - admin
      summary: OpenAPI 3.1 specification (this document)
      operationId: openapi_spec
      responses:
        '200':
          description: OpenAPI YAML
          content:
            application/yaml:
              schema:
                type: string
  /datalog:
    post:
      tags:
      - datalog
      summary: Execute Datalog rules
      operationId: datalog_post
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
      responses:
        '200':
          description: Datalog results
        '400':
          description: Bad request
        '401':
          description: Unauthorized
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
security:
- bearerAuth: []
