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
I have a field annotated with @JsonBackReference, which is the proper way to handle circular references in your Java objects using Jackson. Traditionally, you would normally annotate with @JsonIgnore but this is not recommended by Jackson. In springdoc, it is recommended to use @Schema(hidden = true) to suppress specific fields but this is ignored when a Jackson annotation is present. See this issue for more details.
Steps To Reproduce
Declare the following annotations at the field level:
@JsonBackReference
@Schema(hidden = true)
Expected behavior
The field should not be present when viewing models in the swagger UI.
Additional context
It might be worth noting that Jackson recommends using @JsonManagedReference and @JsonBackReference to handle circular references, and thus should be supported by swagger.
The text was updated successfully, but these errors were encountered:
I have a field annotated with
@JsonBackReference
, which is the proper way to handle circular references in your Java objects using Jackson. Traditionally, you would normally annotate with@JsonIgnore
but this is not recommended by Jackson. In springdoc, it is recommended to use@Schema(hidden = true)
to suppress specific fields but this is ignored when a Jackson annotation is present. See this issue for more details.Steps To Reproduce
Declare the following annotations at the field level:
@JsonBackReference
@Schema(hidden = true)
Expected behavior
The field should not be present when viewing models in the swagger UI.
Additional context
It might be worth noting that Jackson recommends using
@JsonManagedReference
and@JsonBackReference
to handle circular references, and thus should be supported by swagger.The text was updated successfully, but these errors were encountered: