Skip to content

Exclude the discriminator field from getting a nullable_var_annotations #21155

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{#gson}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{^isDiscriminator}}
{{>nullable_var_annotations}}
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public static TypeEnum fromValue(String value) {
}

public static final String JSON_PROPERTY_TYPE = "type";
@javax.annotation.Nullable
protected TypeEnum type;

public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
public class Animal {
public static final String SERIALIZED_NAME_CLASS_NAME = "className";
@SerializedName(SERIALIZED_NAME_CLASS_NAME)
@javax.annotation.Nonnull
protected String className;

public static final String SERIALIZED_NAME_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public static TypeEnum fromValue(String value) {
}

public static final String JSON_PROPERTY_TYPE = "type";
@javax.annotation.Nullable
protected TypeEnum type;

public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@jakarta.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
public class Animal {
public static final String SERIALIZED_NAME_CLASS_NAME = "className";
@SerializedName(SERIALIZED_NAME_CLASS_NAME)
@javax.annotation.Nonnull
protected String className;

public static final String SERIALIZED_NAME_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
public class Animal {
public static final String SERIALIZED_NAME_CLASS_NAME = "className";
@SerializedName(SERIALIZED_NAME_CLASS_NAME)
@javax.annotation.Nonnull
protected String className;

public static final String SERIALIZED_NAME_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
public class Animal {
public static final String SERIALIZED_NAME_CLASS_NAME = "className";
@SerializedName(SERIALIZED_NAME_CLASS_NAME)
@javax.annotation.Nonnull
protected String className;

public static final String SERIALIZED_NAME_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public static TypeEnum fromValue(String value) {
}

public static final String JSON_PROPERTY_TYPE = "type";
@javax.annotation.Nullable
protected TypeEnum type;

public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

public class Animal {
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@javax.annotation.Nonnull
protected String className;

public static final String JSON_PROPERTY_COLOR = "color";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public static TypeEnum fromValue(String value) {
}

public static final String JSON_PROPERTY_TYPE = "type";
@javax.annotation.Nullable
protected TypeEnum type;

public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty";
Expand Down
Loading