default parameters #399
Replies: 1 comment 4 replies
|
We have access to the default value in the model generator so the data is there. I would it expect it to be relatively straight forward for primitive types like String and Int, but for complex types like arrays it might not be trivial. My concern is if this is the expected behaviour for a user of Fabrikt. When used with HTTP client generation the user risks sending fields that he did not actively specify (because of the default value in the generated model). When used on for server generation it might be more appropriate as this aligns with a statement in the OpenAPI 3.0.0 spec:
For route request parameters we already set the default. Example from Micronaut controller generation: MicronautControllerInterfaceGenerator.kt#L227 |

Uh oh!
There was an error while loading. Please reload this page.
would it be easy to add default parameters to the model files, when a default is specified in the openapi file?
All reactions