Код IT
← Каталог

Документирование API с использованием Swagger/OpenAPI — Обработка ошибок

Фрагмент из «Документирование API с использованием Swagger/OpenAPI»: Обработка ошибок.

yaml projectencyclopedia7-08-tehnicheskoe-pismo-3 embed URL статья в энциклопедии
YAML main.yaml
components:
  schemas:
    Error:
      type: object
      properties:
        code:
          type: integer
          description: Код ошибки
        message:
          type: string
          description: Текстовое описание ошибки
        details:
          type: array
          items:
            type: string
          description: Детали ошибки
components:
  schemas:
    Error:
      type: object
      properties:
        code:
          type: integer
          description: Код ошибки
        message:
          type: string
          description: Текстовое описание ошибки
        details:
          type: array
          items:
            type: string
          description: Детали ошибки