Skip to content
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

OpenApiMixin extensions should include Null values #4132

Closed
loomisdf opened this issue Feb 28, 2022 · 2 comments
Closed

OpenApiMixin extensions should include Null values #4132

loomisdf opened this issue Feb 28, 2022 · 2 comments
Assignees

Comments

@loomisdf
Copy link

Summary

Ran into this issue while working with springdocs-openapi springdoc/springdoc-openapi#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.

@frantuma frantuma self-assigned this Mar 1, 2022
@ponelat
Copy link
Member

ponelat commented Jun 2, 2022

@HugoMario could you take a look into fixing this, if it's still an issue. Thanks!

@HugoMario
Copy link
Contributor

fixed by #4468

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

4 participants