You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There is inconsistent handling of custom extensions in the generated OpenAPI documentation when using springdoc-openapi. Specifically, custom extension properties without the x- prefix are not added to the OpenAPI definition in recent versions.
It seems that this breaking change was not described in the release notes, causing unexpected behavior for users upgrading from earlier versions.
To Reproduce
Generate openapi for a controller with a defined custom extension.
What modules and versions of springdoc-openapi are you using? springdoc-openapi-starter-webmvc-api v2.8.4 springdoc-openapi-starter-common v2.8.4
What is the actual and the expected result using OpenAPI Description (yml or json)?
Library does not add custom exception to openapi definition.
Generated openapi specification must have defined by annotations extension.
Provide with a sample code (HelloController) or Test that reproduces the problem
Expected behavior
Generated openapi must have extension in definition.
Additional context 2.6.0 - this version generates extension property "as it is". Name of the extension is exactly the same as defined by user. 2.7.0 - this version generates extension property with x- if extension property name is not prefixed with x-. It it is prefixed then generated definition contains extension property. 2.8.0 - this version generates extension property ONLY when it was defined whit prefix x-. Otherwise extension property is not present in openapi definition.
The text was updated successfully, but these errors were encountered:
Describe the bug
There is inconsistent handling of custom extensions in the generated OpenAPI documentation when using springdoc-openapi. Specifically, custom extension properties without the
x-
prefix are not added to the OpenAPI definition in recent versions.It seems that this breaking change was not described in the release notes, causing unexpected behavior for users upgrading from earlier versions.
To Reproduce
Generate openapi for a controller with a defined custom extension.
To generate openapi below test can be used:
What version of spring-boot you are using?
3.4.2
What modules and versions of springdoc-openapi are you using?
springdoc-openapi-starter-webmvc-api v2.8.4
springdoc-openapi-starter-common v2.8.4
What is the actual and the expected result using OpenAPI Description (yml or json)?
Library does not add custom exception to openapi definition.
Generated openapi specification must have defined by annotations extension.
Provide with a sample code (HelloController) or Test that reproduces the problem
Expected behavior
Generated openapi must have extension in definition.
Additional context
2.6.0
- this version generates extension property "as it is". Name of the extension is exactly the same as defined by user.2.7.0
- this version generates extension property withx-
if extension property name is not prefixed withx-
. It it is prefixed then generated definition contains extension property.2.8.0
- this version generates extension property ONLY when it was defined whit prefixx-
. Otherwise extension property is not present in openapi definition.The text was updated successfully, but these errors were encountered: