info:
  description: |
    API for checking if a number is a prime number.

    **Authentication Options**:
    - Recommended: Bearer token via `Authorization` header.
    - Fallback (GET): `token` query parameter.
    - Fallback (POST): `apiKey` in JSON body.
  title: Prime Number Checker API
  version: 1.2.0
openapi: 3.0.0
paths:
  /api/v1/prime-number-checker:
    post:
      requestBody:
        content:
          application/json:
            schema:
              properties:
                apiKey:
                  type: string
                number:
                  type: integer
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  isPrime:
                    type: boolean
                type: object
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '429':
          description: Too many requests
      summary: Check if a number is a prime number.
    get:
      parameters:
        - in: query
          name: number
          schema:
            type: integer
          required: true
          description: The number to check for primality.
        - in: query
          name: token
          schema:
            type: string
          description: Fallback authentication token.
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  isPrime:
                    type: boolean
                type: object
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '429':
          description: Too many requests
      summary: Check if a number is a prime number.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

security:
  - bearerAuth: []  # Global security, but overridden per-path
servers:
- url: https://infinitode.netlify.app
