openapi: 3.0.3
info:
  title: Repzo API - Settings
  version: 1.0.0
  description: OpenAPI specification for Repzo Settings endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /settings:
    get:
      summary: Find settings
      operationId: findSettings
      parameters:
        - in: query
          name: params
          schema:
            type: object
          description: Query parameters for filtering settings
      responses:
        "200":
          description: A list of settings
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SettingsFindResult"
  /settings/{id}:
    get:
      summary: Get settings by ID
      operationId: getSettings
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Settings details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SettingsGetResult"
    put:
      summary: Update settings
      operationId: updateSettings
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SettingsUpdateBody"
      responses:
        "200":
          description: Settings updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SettingsUpdateResult"
components:
  schemas:
    SettingsFindResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Settings"
        meta:
          type: object
    SettingsGetResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Settings"
    SettingsUpdateBody:
      type: object
      properties:
        key:
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
        category:
          type: string
        description:
          type: string
    SettingsUpdateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Settings"
    Settings:
      type: object
      properties:
        _id:
          type: string
        key:
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
        category:
          type: string
        description:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
