Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[v10.1.1] SwaggerParser.dereference not ignoring $ref sibling properties (OpenAPI 3.1.0 requestBody) #274

Copy link
Copy link
Open
@Jaydeepkakadiya19

Description

@Jaydeepkakadiya19
Issue body actions

In OpenAPI 3.1.0, sibling properties of $ref (except summary and description) in Reference Objects should be ignored (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#reference-object).

However, when dereferencing my 3.1.0 definition with @apidevtools/swagger-parser (v10.1.1), sibling properties in the requestBody schema are not ignored. For example, at

 paths -> /customer -> post -> requestBody -> content -> application/json -> schema

in the dereferenced output (see CodeSandbox: https://codesandbox.io/p/sandbox/swagger-ui-forked-f627d8 ), the sibling example and type are being used instead of those in the referenced schema.

Expected: Sibling properties (like example, type) should be ignored, inheriting only from the referenced schema.

Observed: Sibling properties are being processed and taking precedence.

Please do let me know if I misunderstood or missed any Openapi rules here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.