Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Jaydeepkakadiya19 opened this issue May 5, 2025 · 0 comments

Comments

@Jaydeepkakadiya19
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant