[discussion] defaultValue for client vs server models
Description
The following concern was raised in chat:
Writing a client generator: Do clients normally include the defaultValue for model vars? Shouldn't they be filled in by the server (the consumer) and so, not be included in client code?
The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schema-object
So, I'm thinking that "consumer of the input" is the server, not the generated client code, and so the defaultValue might be in a comment, but should not be sent to the server in requests and should not be automatically added to responses where the server didn't include it.
Should we consider an option to support a concept such as separating input vs response models? The idea would be to provide default values on server side input processing, but not for client side model construction (allowing server to provide default for any missing properties).
openapi-generator version
n/a
OpenAPI declaration file content or url
Command line used for generation
n/a
Steps to reproduce
n/a
Related issues/PRs
n/a