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

[REQ] [Dart] Remove redundant null checks

Created by: nickmeinhold

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

The fromJson methods in my models have lots of redundant checks like this:

if (json['stop_distance'] == null) {
  stopDistance = null;
} else {
  stopDistance = json['stop_distance'];
}

Describe the solution you'd like

Remove redundant check and just assign:

stopDistance = json['stop_distance'];

Describe alternatives you've considered

I'll start a PR now, should just be a small change to class.mustache I believe.

Assignee
Assign to
Time tracking