OpenAPITools / OpenAPITools/openapi-generator

[BUG][dart2] Description

Open
#5,322 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Dart Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix
Description

Using the dart generator and publishing the generated content to pub.dev we can see some health suggestions regarding the effective dart style: https://pub.dev/packages/gitea_openapi#-analysis-tab-

It would be best to follow the dart style.

openapi-generator version

4.2.3

OpenAPI declaration file content or url
Command line used for generation

java -jar .\openapi-generator-cli-4.2.3.jar generate -g dart -i https://try.gitea.io/swagger.v1.json -o C:\dev\gitea2 --additional-properties pubName=gitea

Steps to reproduce

run generate command above and check output in supporting files

Related issues/PRs

Non found

Suggest a fix

Update templates to add curly braces for all flow control structures and don't explicitly initialize variables to null.

Could you guide me on how to update the template?

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 with the supplied OpenAPI Generator 4.2.3 command and inspect the generated Dart supporting files referenced by the pub.dev analysis. Trace those outputs back to the Dart generator templates and compare the reported effective-Dart suggestions with the requested style changes. Done means the generated package no longer produces those suggestions.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
api, 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.