Field with @JsonIgnore is shown in model schema
See original GitHub issueI have this class, with ignored field ga
, but the field is still shown in the model schema.
@AllArgsConstructor
@EqualsAndHashCode
public class GAV {
@JsonIgnore
@NonNull
private final GA ga;
@Getter
@NonNull
private final String version;
@JsonCreator
public GAV(@JsonProperty("groupId") String groupId,
@JsonProperty("artifactId") String artifactId, @JsonProperty("version") String version) {
this.ga = new GA(groupId, artifactId);
this.version = version;
}
@JsonIgnore
public GA getGA() {
return ga;
}
public String getGroupId() {
return ga.getGroupId();
}
public String getArtifactId() {
return ga.getArtifactId();
}
@Override
public String toString() {
return getGroupId() + ":" + getArtifactId() + ":" + getVersion();
}
}
{
"ga": {
"groupId": "string",
"artifactId": "string"
},
"version": "string",
"groupId": "string",
"artifactId": "string"
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Ignore fields from Java object dynamically while sending as ...
Show activity on this post. You can set @JsonIgnore of course on field, setter or getter like described here. And, if you want...
Read more >Jackson @JsonIgnore, @JsonIgnoreProperties and ...
In this tutorial, I show you how to ignore certain fields when serializing an object to JSON using Jackson @JsonIgnore, @JsonIgnoreProperties and ...
Read more >Jackson Ignore Properties on Marshalling - Baeldung
This tutorial will show how to ignore certain fields when serializing an object to JSON using Jackson 2.x.
Read more >@JsonIgnore to ignore values on de-serializing from JSON to ...
Hi,. We have scenario where we need to ignore values on de-serializing from JSON to Java object ( or basically, it's a read...
Read more >C# serialization with JsonSchema and System.Text.Json | endjin
But for an if constraint you will have to validate the if schema against the object, and then you know that the instance...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For now you can use
@ApiModelProperty(hidden=true)
as a workaround.Yeah, that’s a known limitation. Please see https://github.com/swagger-api/swagger-core/issues/1214#issuecomment-129709818.