OpenAPI Integration for generating RequestBody
when referencing parts of a request body in micronaut
#1891
Replies: 2 comments
-
@akhil-ghatiki In Micronaut openapi all the features that users request or I come up with myself are gradually being implemented. What you wrote is not supported at the moment, but not because there are any restrictions, I just never used this micronaut feature and no one asked to add support for this feature. You are the first one who did it :-). Well, if you want this feature to be added - describe the case in detail in the issue: what code do you have, and what should be generated. And then I will add this feature. For the future: it is better not to write in the discussions, but to create an issue. I forget to look through the discussions, so I do not answer for a long time |
Beta Was this translation helpful? Give feedback.
-
@akhil-ghatiki Anyway I already fixed it here: #1914 . Wait next release |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
In our Micronaut application, we’re retrieving parts of the request body via reference rather than deserializing the entire object upfront. Here’s an example:
The incoming request body looks like this:
We took this approach for these reasons - Structured Request Pattern, Validation Considerations, Metadata is consistently used across multiple endpoints
This approach works as intended in Micronaut, but the OpenAPI integration doesn’t seem to handle this use case correctly.
The RequestBody generated by the OpenAPI for this scenario is not as expected. It generated the request body as below:
Instead of manually working around this, we’re considering pointing this out to the contributors in case it’s a gap in the OpenAPI integration.
My questions are:
Any advice or insights would be appreciated!
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions