代码之家  ›  专栏  ›  技术社区  ›  Sankar

swagger没有呈现requestbody

  •  0
  • Sankar  · 技术社区  · 6 年前

    requestBody 不会在夸张的GUI上呈现。我只是得到一个 parameters

    paths:
      /my-api:
        post:
          summary: My API Summary
          description: My API Description
          tags:
            - Cost Center
          requestBody:
            required: true
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: '#/components/schemas/ReqBodyStruct'
    

    Screnshot

    如何使RequestBody也显示在swagger gui中?我错过什么了吗?

    1 回复  |  直到 6 年前
        1
  •  1
  •   user667    5 年前

    根据这两个问题 OAS 3.0: Support for media type examples (aka request/response body examples) #3437 Examples are not showing #2651 在Swagger UI github页面中,应该在版本中修复这个问题 3.23.0