You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using swagger-codegen-generators-1.0.50, I was trying to configure the generator to generate the service interfaces in such a way that they use real type as return value, not generic Resposnse. This is setup that I used with swagger 2 which I am now trying to modernize to openapi 3. So I don't want this:
which is much preferred - more type safe, easier to implement. The wrapping is then done in the PetApi wrapper.
It seems to me that the useGenericResponse was supposed to control this behavior, that is, by default the return values of services should not be generic, unless you set this option. There is even a template JavaJaxRS/cxf/apiServiceImpl.mustache:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When using swagger-codegen-generators-1.0.50, I was trying to configure the generator to generate the service interfaces in such a way that they use real type as return value, not generic Resposnse. This is setup that I used with swagger 2 which I am now trying to modernize to openapi 3. So I don't want this:
but someting like this:
which is much preferred - more type safe, easier to implement. The wrapping is then done in the PetApi wrapper.
It seems to me that the useGenericResponse was supposed to control this behavior, that is, by default the return values of services should not be generic, unless you set this option. There is even a template JavaJaxRS/cxf/apiServiceImpl.mustache:
which seems to honor this option, but other templates just hardcode using Response and direct delegation between the wrapper and the service.
Am I missing something, or is this something to be improved?
Beta Was this translation helpful? Give feedback.
All reactions