mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 02:57:04 +00:00
[Java] [Spring-client] Exclude discriminator from nullable annotation (#21981)
* Exclude the discriminator from getting a nullable-annotation * Update samples
This commit is contained in:
committed by
GitHub
parent
ac3c37095d
commit
73c8728343
@@ -47,7 +47,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
public class Animal {
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
@jakarta.annotation.Nonnull
|
||||
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
|
||||
protected String className;
|
||||
|
||||
public static final String JSON_PROPERTY_COLOR = "color";
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ParentWithNullable {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_TYPE = "type";
|
||||
@jakarta.annotation.Nullable
|
||||
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
|
||||
protected TypeEnum type;
|
||||
|
||||
public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty";
|
||||
|
||||
Reference in New Issue
Block a user