OpenAPI Shows Duplicate Fields Because It Uses Both Fields and Getters #2327
-
SmallRye OpenAPI is generating duplicate entries in my schema because it’s reading both the fields and the getter/setter methods from my class. I want to stop it from using the getters/setters and only use the fields — and I want to do this without annotations and changes on the class code. Is there any way in which this can be done? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Hi @ClaudiaIoana do you have a sample class you can share? |
Beta Was this translation helpful? Give feedback.
-
Yes. So for example in my class i have the field: public String getDescription() { and in OpenApi it will appear like: This even though the class does not have a field description. |
Beta Was this translation helpful? Give feedback.
-
Please try setting |
Beta Was this translation helpful? Give feedback.
-
I tried setting mp.openapi.extensions.smallrye.private-properties.enable=false as you suggested, and it seems to work well for my end goal. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I will open a different discussion for the second problem. |
Beta Was this translation helpful? Give feedback.
Please try setting
mp.openapi.extensions.smallrye.private-properties.enable=false
in your application configuration. Note that this will ignore allprivate
properties and will rely on the methods for properties and their names.