swagger-api / swagger-api/swagger-codegen

Please support null-safety on Dart generator

Open
#11,294 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Dart 2.13 added null-safety to the language, and swagger-codegen generator is not compatible with it, generating a code that won't compile.

Reference:
https://dart.dev/null-safety

Swagger-codegen version

3.0.30

Command line used for generation

swagger-codegen generate -i https://$MY_API/api/swagger.json -l dart

Suggest a fix/enhancement

https://dart.dev/null-safety

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported swagger-codegen generate -i https://$MY_API/api/swagger.json -l dart command and inspect the generated Dart client for constructs incompatible with Dart 2.13 null-safety. Read the Dart generator templates and compare their output with the null-safety requirements at https://dart.dev/null-safety; done means the generated client compiles with null-safety enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.