We are using codegen to generate the types used by our APIs, and we have a problem generating the responses of an API in a decent way.
As described here: https://github.com/swagger-api/swagger-codegen/issues/2868 , the responses classes are created with “cryptic” name rather than a real type.
I have tried two things:
- Using a Custom schema - To add a “title” field to the responses as suggested by the link - it works by editing the json, but to make it usable we need to a dd “title” field also to the UI.
- Using a reference - I have tried defining the responses as a model, and then to refer to it (so instead of referring to /responses it is mapped to /definitions) - but the UI does not show the models as option in the references dropdown in the UI. Please note that manually editing the json seems to pass without any error.
What is the best way to handle it ?