Skip to content

[REQ] set default value "None" to non-requied field of akka-http-server model #12067

@jsoizo

Description

@jsoizo

Is your feature request related to a problem? Please describe.

When using akka-http-server generator, non required field of model has no default value.

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/scala-akka-http-server/model.mustache#L22

This makes it necessary to explicitly provide the values of the added non-required fields when they are added to the generated model at the user of the model.

On the other hand, akka-client generator provides the default value, and doesn’t have the same issue.
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/scala-akka-client/model.mustache#L16

Describe the solution you'd like

Add None as default value when the field is required, in imitation of akka-client

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions