Hello maintainers.
First of all thank you for the great work on codegen, it is nice having such a tool in Scala.
While experimenting with it, I found that default values work perfectly for request bodies, but are ignored in parameters (query, headers, path).
Adding such support would be nice, and make for a more coherent experience across the different openapi items.
I did not find it clear if I should open an issue before opening a PR, but I have worked on adding this support in my fork. The included swagger can be used to reproduce the issue (no default value in the generated code).
This is a proposal and maybe you have a better way of implementing it with your knowledge of the code base, as adding support for basic schemas was pretty trivial, but handling schema refs required more substantial changes, and this may need a better refacto than what I submitted, hence why i separated it in two commits.
Thanks for your time, and please let me know if you want me to open the PR.
Hello maintainers.
First of all thank you for the great work on codegen, it is nice having such a tool in Scala.
While experimenting with it, I found that default values work perfectly for request bodies, but are ignored in parameters (query, headers, path).
Adding such support would be nice, and make for a more coherent experience across the different openapi items.
I did not find it clear if I should open an issue before opening a PR, but I have worked on adding this support in my fork. The included swagger can be used to reproduce the issue (no default value in the generated code).
This is a proposal and maybe you have a better way of implementing it with your knowledge of the code base, as adding support for basic schemas was pretty trivial, but handling schema refs required more substantial changes, and this may need a better refacto than what I submitted, hence why i separated it in two commits.
Thanks for your time, and please let me know if you want me to open the PR.