swagger-api / swagger-api/swagger-codegen

Client code in Dart doesn't compile with latest Flutter SDK

Open
#12,054 6 comments 5 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

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:

grafik

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.