swagger-api / swagger-api/swagger-codegen
Client code in Dart doesn't compile with latest Flutter SDK
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Q&A (please complete the following information)
- OS: Windows 10
- Browser: Firefox
- Version: 109.0.1
- Method of installation: [e.g. npm, dist assets] webapp
- Swagger-Editor version: [e.g. 3.10.0]
- Swagger/OpenAPI version: [OpenAPI 3.0]
Content & configuration
-Load the petstore API 3.0
- generate Dart Client code and open it on a system with the latest Flutter /Dart SDK installed
Describe the bug you're encountering
It clearly shows that the generated code isn't compatible with the latest Dart compiler versions. Especially it hasn't be adapted to non nullability of the Dart language, so the code has lots and lots of warnings and errors:

Expected behavior
production of valid Dart code
Additional context or thoughts
depending on how your code generator is implemented I maybe able to help you fix the code
I really like the idea of using SwaggerHub in our company but without valid Dart code it doesn't make sense
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by loading the Petstore OpenAPI 3.0 definition and generating a Dart client, then open the generated client with the latest Flutter/Dart SDK. Inspect the generated output for null-safety compiler errors; done means the client is valid Dart code that compiles without the reported warnings and errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100