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
When using oneOf for request of response schema, and the specialization contains oneOf as its property, the @JsonIgnoreProperties annotation is added but its import is not. Because of this, the source code cannot be compiled.
The problem is within the following method: org.openapitools.codegen.languages.AbstractJavaCodegen#addImportsToOneOfInterface, where the import request for JsonIgnoreProperties is missing.
Incorrect:
for (Stringi : Arrays.asList("JsonSubTypes", "JsonTypeInfo")) {
Fixed version:
for (Stringi : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) {
The text was updated successfully, but these errors were encountered:
Hi @ondrej-simon I have tried this with the latest version 7.7.0 and in my case the import com.fasterxml.jackson.annotation.JsonIgnoreProperties was there.
Description
When using oneOf for request of response schema, and the specialization contains oneOf as its property, the
@JsonIgnoreProperties
annotation is added but its import is not. Because of this, the source code cannot be compiled.openapi-generator version
7.7.0-SNAPSHOT
OpenAPI declaration file content or url
Generation Details
Generation was performed on the
master
branch of the openapi-generator project, pulled directly from this GitHub repository.Steps to reproduce
modules/openapi-generator/src/test/resources/3_0/spring/oneof-within-oneof.yaml
,org.openapitools.codegen.java.spring.SpringCodegenTest
, verifying the import is not added.Suggest a fix
The problem is within the following method:
org.openapitools.codegen.languages.AbstractJavaCodegen#addImportsToOneOfInterface
, where the import request forJsonIgnoreProperties
is missing.Incorrect:
Fixed version:
The text was updated successfully, but these errors were encountered: