-
Notifications
You must be signed in to change notification settings - Fork 761
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
Swagger spec is not normalized if structure is hidden behind a reference #1396
Comments
The same bug will be part of normalization that will be introduced for OpenAPI 3.1 in #2738. This issue needs to be processed after introducting OpenAPI 3.1.0 support in swagger-client for both OpenAPI 2.0 - 3.0.x and OpenAPI 3.1.0 normalizations. |
We will not be addressing this bug in old specmap based dereferencing algorithm, but we will address it in new ApiDOM based dereferencing. ApiDOM based dereferencing is currently handling OpenAPI 3.1.0 exclusively. Old specmap based dereferencing is handling OpenAPI 2.0 and OpenAPI 3.0.x. In future ApiDOM based dereferencing will completely replace specmap based dereferencing so this bug will be remediated fully. Later solution proposal addressed ApiDOM based dereferencing only. SolutionWe can reduce pathDiscriminator is NOT set
Additional metadata for individual plugins will be maintained on additional fields:
pathDiscriminator is setIf if Required characteristicsAll normalization plugins MUST implement idempotence. This means that each plugin with maintain information about what has already been normalized, and if it traverse the already normalized piece of data, it must skip the normalization. Implication is that we can run normalization multiple times on whole documents.
|
Next job consists of 3 steps:
These steps are performed after next ApiDOM release is issued. |
Refs #1396 Co-authored-by: Vladimir Gorej <[email protected]>
## [3.28.3](v3.28.2...v3.28.3) (2024-08-09) ### Bug Fixes * **resolver:** disable Server Objects normalization for OpenAPI 3.1.0 ([#3628](#3628)) ([d63f33f](d63f33f)), closes [#3627](#3627) * **resolver:** don't skip normalization of OpenAPI 3.1.0 specs ([#3575](#3575)) ([bc4a40c](bc4a40c)), closes [#1396](#1396)
I tracked down a regression in
swagger-ui
to an interaction between swagger normalization and subtree resolution introduced in #1274.With that change, normalization happens only before subtree resolution, and this breaks in cases where the structure of the references hides the structure of the swagger file from normalization.
I boiled it down to this this test master...biochimia:regression/normalize-before-resolution
Q&A (please complete the following information)
Content & configuration
Test case: master...biochimia:regression/normalize-before-resolution
Swagger/OpenAPI definition:
Swagger-Client usage:
Describe the bug you're encountering
Because
normalizeSwagger()
doesn't get to see the structure of the path object before resolution, if doesn't copy path parameters into individual methods. Later when the subtrees are resolved normalization is already disabled and is not performed.To reproduce...
Steps to reproduce the behavior:
Expected behavior
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered: