kokuwaio/micronaut-openapi-codegen

useGenericResponse false generates wrong return type on petstore.yml

Closed this issue · 2 comments

Hi, first of all great job on this generator. This is exactly what I was looking for.
However when setting useGenericResponse to false it doesn't seem to work for methods return List. This can be reproduced with this yaml => https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml
void createPets(); & Pet showPetById(...) are correct but listPets results in: HttpResponse<java.util.List> listPets(...).
Hope you can fix this. Thanks!

Hi, the generic response is generated because the response can have a http header. The generator checks for this. Is a config option forceNonGeneric a valid solution for your usecase?

br, stephan

Hi thanks for the reply. I totally missed the fact that the response had a http header and that's why the response wrapper is needed. In that case the generated code is correct. No extra config option needs to be added in my opinion. I tested with my own openapi file and everything worked as expected.