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
  • #3633
Closed
Open
Issue created Aug 13, 2019 by Administrator@rootContributor

[REQ] [Dart] Don't initialize variables to null

Created by: nickmeinhold

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

Models have their members initialized to null which is against the Effective Dart guidelines.

Describe the solution you'd like

When the default value is null, just declare the variable as in Dart, "a variable or field that is not explicitly initialized automatically gets initialized to null" and "Adding = null is redundant and unneeded."

Describe alternatives you've considered

I tried using an inverted section based on the defaultValue but it didn't work, I don't know mustache well enough yet but I'll come back to it.

Additional context

https://dart.dev/guides/language/effective-dart/usage#dont-explicitly-initialize-variables-to-null

Assignee
Assign to
Time tracking