openapi: "3.1.0"
info:
  title: "Search API"
  version: "1.0.0"
  description: "Full-text search and indexing across multiple resources Exported as an OpenAPI 3.1 document from Fake API for Devs."
servers:
  - url: "https://fakeapifordevs.vercel.app"
        description: "Fake API for Devs production endpoint"
tags:
  - name: "Search"
        description: "Full-text search and indexing across multiple resources"
paths:
  /api/search:
    get:
      tags:
        - "Search"
      summary: "GET /api/search?q=john&domains=auth,crm,hrm"
      operationId: "search_get_search"
      parameters:
        - name: "page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      default: 1
                    description: "1-indexed page number for collection endpoints."
        - name: "per_page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      maximum: 50
                      default: 10
                    description: "Page size for collection endpoints."
        - name: "q"
                    in: "query"
                    schema:
                      type: "string"
                    description: "Optional text search filter where supported."
        - name: "delay"
                    in: "query"
                    schema:
                      type: "number"
                      minimum: 0
                      maximum: 10
                    description: "Optional artificial delay in seconds."
        - name: "simulate_error"
                    in: "query"
                    schema:
                      type: "string"
                      enum:
                        - "rate_limit"
                        - "server_error"
                        - "not_found"
                        - "unauthorized"
                        - "forbidden"
                        - "bad_request"
                        - "service_unavailable"
                        - "timeout"
                        - "malformed"
                    description: "Force a mock failure scenario for resilience testing."
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
  /api/search/index:
    post:
      tags:
        - "Search"
      summary: "POST /api/search/index"
      operationId: "search_post_search_index"
      parameters:
        []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
            example:
              document:
                id: "doc_123"
                title: "Mock API quick start"
                body: "Use Fake API for Devs to ship prototypes faster."
              tags:
                - "guides"
                - "mock-apis"
              locale: "en-US"
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"