Redocly/redoc

OpenAPIParser's merge allOf doesn't merge examples

Open

#1,200 创建于 2020年3月9日

在 GitHub 查看
 (1 评论) (1 反应) (0 负责人)TypeScript (2,272 fork)batch import
Type: Enhancementhelp wantedopenapi

仓库指标

Star
 (21,877 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

I have the following response:

          "200" : {
            "description" : "The request has succeeded.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object",
                  "properties" : {
                    "statistics" : {
                      "allOf" : [ {
                        "$ref" : "#/components/schemas/pageStatistics"
                      }, {
                        "example" : {
                          "currentPage" : 1,
                          "pageSize" : 1
                        }
                      } ]
                    }
                  }
                }
              }
            }
         }

statistics uses a schema which contains a sample response, but it gets overwritten by example and it shall contain only two properties. It renders correctly in SwaggerUI, but not with Redoc as seen in the attached image.

Screen Shot 2020-03-09 at 14 49 23

贡献者指南