0

我正在使用swagger,并且我有以下端点参数文档:

  - in: header
    name: X-Request-ID
    schema:
      type: string
      format: uuid
      required: true
    description: User firebase id
definitions:
  error_response:
    type: object
    properties:
      error:
        type: string
  ok_response:
    type: object
    properties:
      data:
        type: string
responses:
  400:
    description: User already exists in db
    schema:
      $ref: '#/definitions/error_response'
    examples:
      error: 
        'No id token provided'
  401:
    description: No id token provided, User acount is not verified in firebase, Token is invalid
    content:
      application/json:
        schema:
          $ref: '#/definitions/error_response'
        examples: 
          No id token provided
  201:
    description: User created
    content:
      application/json:
        schema:
          $ref: '#/definitions/ok_response'
        example: 
          error:User created

问题是当我尝试查看 url 中的架构时,没有显示示例

在此处输入图像描述

为什么 swagger 没有在 201 响应中显示示例?

谢谢

4

0 回答 0