Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #12067
Closed
Open
Issue created Apr 06, 2022 by Administrator@rootContributor

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

Created by: 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

Assignee
Assign to
Time tracking