OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.64k stars 6.53k forks source link

[REQ] [Dart] Generated code ready to be published to pub #3912

Open benjaminSchilling33 opened 5 years ago

benjaminSchilling33 commented 5 years ago

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

The generated code can not be published to pub without manual post-processing due to mismatch with the Dart guidelines.

  1. The docs directory should be named doc
  2. The pubspec is missing the author and homepage
  3. The overall score in the pub analyzis is very low (Example) 3.1 CHANGELOG.md and examples are missing 3.2. As described in #3633 variables should not be initialized with null

Describe the solution you'd like

nickmeinhold commented 5 years ago

Thanks for the issue!

Are you proposing we assume the generated packages will be hosted on the Pub site?

I guess the positive side to that is it will save time for some (those that do want that) but then it (depending on how the solution is implemented) could be leaving unwanted clutter for those that don't.

One major downside in my opinion to removing any friction so the generated package is automatically ready to publish (but has not been tested) has potential to be part of the flood of low quality packages that can be problematic for package management systems. I know this isn't the strongest argument so happy to be convinced and/or overridden.

I'm not trying to shoot this down, just some thoughts. Thanks again.

benjaminSchilling33 commented 5 years ago

@nickmeinhold I thought about the same issues that you mentioned, but using the generated code via a dependecy makes maintenance a lot easier then having to copy it manually. The generated code would be useful only for path packages right now.

I would like to provide more pull requests in the future that enhance the analyzis score of the generated code and thus making the code generation results better

nickmeinhold commented 5 years ago

Sounds great!

So currently the generated README has advice on using the package as either a Path package or a Git package - the latter doesn't require any extra maintenance right? Have I misunderstood? Why do you say the generated code would be useful only for path packages right now?

benjaminSchilling33 commented 5 years ago

That's correct, I forgot about Git packages. But for publishing the pubspec requires the extra fields.