Skip to content

How to Configure SmallRye to Avoid Circular References in OpenAPI Documents? #1593

Closed Answered by MikeEdgar
pv77-2 asked this question in Q&A
Discussion options

You must be logged in to vote

You could implement an OASFilter and change the schemas after they are generated. Are the classes below an accurate representation of your model? It may be the case that the circular refs are fine. Another option if you don't want one of them to be present would be to use @Schema(hidden = true) on the field you wish to hide.

@Schema(name = "ComponentA")
class ComponentA {
    ComponentB refToB;
}

@Schema(name = "ComponentB")
class ComponentB {
    ComponentA refToA;
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pv77-2
Comment options

@MikeEdgar
Comment options

Answer selected by phillip-kruger
@codespearhead
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants