swagger-core
swagger-core copied to clipboard
OpenApiMixin extensions should include Null values
Summary
Ran into this issue while working with springdocs-openapi https://github.com/springdoc/springdoc-openapi/issues/1525 Null vendor exensions are allowed via the OpenAPI spec detailed here
The extension value can be a primitive, an array, an object or null
However, they are not being rendered because the OpenApiMixins class is not setup to do so.
Expected Output
"x-my-vendor-extensions": {
"property1": "value1",
"property2": null
}
Actual Output
"x-my-vendor-extensions": {
"property1": "value1"
}
Solution
I believe the @JsonInclude(value = Include.ALWAYS) annotation should be added here.
@JsonAnyGetter
@JsonInclude(value = Include.ALWAYS)
public abstract Map<String, Object> getExtensions();
A similar workaround has been added to the springdocs-openapi project.
@HugoMario could you take a look into fixing this, if it's still an issue. Thanks!
fixed by #4468