-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ][dart] Dart full OAS3 support #8179
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
@agilob FYI if you have time to tackle some of the Dart issues |
Might have more time in 2 weeks during Xmas break, but can't promise it. |
Dart-dio now compiles with full OAS3 fake petstore. |
I'm curious, is But still I'm not able to even compile the project, there's still some issues with enum names :/ Edit: I've updated my gist, dart analyzer is kinda happy now, but I haven't tested it on runtime yet. |
@Grohden are you using the latest master to generate the Dart API client? There's been many enhancements, bug fixes to the Dart generators |
@wing328 I'm manually copying the current master dart templates. |
You can find the snapshot version of the latest master in the project's README |
@Grohden you can not only copy the templates, that is not enough, there are many changes in the generators as well. The problems regarding json serialization are listed as todos. |
@Grohden If you have specific solutions to the some of the json mapping problems, please don't hesitate to post them here. The dart generator is not my primary focus so any help is appreciated. |
I have updated the known compile errors at the top. |
@kuhnroyal I've downloaded the latest master (this project could suggest a clone with depth=1 btw) and built the package.. it fixed some issues (inline enum probably), but still it had problems, so I fixed them for myself. Here's my commit Grohden@72c8e15, maybe I will open a PR later... but all those fixes were for my project and I can't guarantee that all those casts will work (I've tested a single method in runtime and it worked) In any case the project wasn't even compiling without them, so it's better than nothing. Edit: had to ammend a change in the commit, I've update its URL |
What Dart version are you using? Curious why all the casts are necessary. |
Using dart 2.11.0-213.1.beta, Hmm, so you're not using dart analyzer? or is using it without I always use dart analyzer with strong mode, and I've generated my api client 'inside' (as a package) my project, so it's probably inheriting my rules... I'm also not sure that if you're using strong mode it applies to all libs used. if you generate the petstore example and enable the strong mode with a file in the root called
you probably gonna see the same compile errors as I.. but I'm not sure if that's desirable 🤔 |
I've tested a few things:
My branch probably fixes these:
If all of those issues were found by trying to compile the fake petstore they're probably fixed in my brach as I've also tested it against the fake petstore api.. In any case, as I've said, those fixes were for my project, so if I open a PR I cannot guarantee that it will work for all cases.. |
I always use strict-mode but I just recently started helping out here. I opened #8231 yesterday but thats just for dart-dio. |
@kuhnroyal u mean dynamics to a "more specialized dynamic"? (like |
I know, I have a branch with this but the casts are not all needed with Dart 2.9 analyzer:
language:
strict-inference: true
strict-raw-types: true
strong-mode:
implicit-dynamic: false |
This is an epic to track remaining work for full dart/dart-dio OAS3 support.
General:
File
. This is generated as a separate model in the Go client but asjava.io.File
in Java/Kotlin. It should probably be a separate model. Currently this leads to compile errors. (addressed by [dart][dart-dio] Prevent name clashes with existing dart types #8198)Dart:
Map.mapFromJson
. There are open issues for this and the problem is now evident in the generated fake petstore.Related issues: [BUG][Dart] Map.mapFromJson is generated, but there's no such method on map. #8029
Map<String, Map<String, String>>
Map<String, Enum>
List<List<ReadOnlyFirst>>
double
, de-serialization via switch statement doesn't work hereList<Object>
tries to callObject.mapFromJson
Client
, this conflict withhttp.Client
(addressed by [dart][dart-dio] Prevent name clashes with existing dart types #8198)Dart-Dio:
bool
andList
, basically everything that is not aString
(addressed by [dart-dio] Allow dynamic headers and add additional dio parameters #8191)The text was updated successfully, but these errors were encountered: