Redocly/redoc

OpenAPIParser's merge allOf doesn't merge examples

Open

#1,200 opened on 2020年3月9日

GitHub で見る
 (1 comment) (1 reaction) (0 assignees)TypeScript (2,272 forks)batch import
Type: Enhancementhelp wantedopenapi

Repository metrics

Stars
 (21,877 stars)
PR merge metrics
 (30d に merged 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

コントリビューターガイド