http response status annotation generation #338
Replies: 2 comments 1 reply
-
Currently, there is no explicit support for this. You would use a I see that it is not perfect to keep that in sync with the OpenAPI manually. What would be the rule to add it automatically? Something like: Add If added automatically, I wonder if it is worth skipping it for 200. I think yes, less noise for most endpoint 😊 |
Beta Was this translation helpful? Give feedback.
-
Maybe something like that - generate spring ResponseStatus annotation with http status code:
Less noise in generated code is one of reasons i'm trying to migrate away from openapi generator :) |
Beta Was this translation helpful? Give feedback.
-
Migrating from openapi generator.
I have usecase when single successful response of endpoint does not have http status code 200, but something else, typically 204
I did not found possibility to automatically generate
@ResponseStatus(HttpStatus.NO_CONTENT)
annotation for api interfacemethod?
Manually adding annotation to api implementation method seems errorprone if openapi definition file created and updated by somebody else?
Automatic generation should probably only work if
result-style: success
Beta Was this translation helpful? Give feedback.
All reactions