-
Hello, I'm currently facing an issue with circular references in the OpenAPI document generated by SmallRye. Specifically, I have a component that has a property referencing another component, which in turn has a property referencing back to the first component. This creates a circular reference in the OpenAPI schema. Is there a way to configure SmallRye to handle this scenario gracefully? I'm open to using annotations, plugin configurations, or any other method that could help resolve or mitigate this issue. Here's a simplified example to illustrate the problem: components: Any guidance on how to avoid or resolve such circular references would be greatly appreciated. Thank you in advance for your assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@pv77-2 are you looking for the referenced schemas to be in-lined directly within the schema? |
Beta Was this translation helpful? Give feedback.
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.