question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[REQ][dart] Dart full OAS3 support

See original GitHub issue

This is an epic to track remaining work for full dart/dart-dio OAS3 support.

General:

  • OAS3 fake petstore contains a model called File. This is generated as a separate model in the Go client but as java.io.File in Java/Kotlin. It should probably be a separate model. Currently this leads to compile errors. (addressed by https://github.com/OpenAPITools/openapi-generator/pull/8198)

Dart:

  • There are problems regarding deserialization of maps, de-serialization code is trying to call Map.mapFromJson. There are open issues for this and the problem is now evident in the generated fake petstore. Related issues: https://github.com/OpenAPITools/openapi-generator/issues/8029
  • De-serialization of maps of maps e.g. Map<String, Map<String, String>>
  • De-serialization of maps of enums e.g. Map<String, Enum>
  • De-serialization of list of list of model e.g. List<List<ReadOnlyFirst>>
  • Support enums of type double, de-serialization via switch statement doesn’t work here
  • De-serialization of List<Object> tries to call Object.mapFromJson
  • OAS3 fake petstore contains a model called Client, this conflict with http.Client (addressed by https://github.com/OpenAPITools/openapi-generator/pull/8198)

Dart-Dio:

  • Compile errors regarding header parameters of type bool and List, basically everything that is not a String (addressed by #8191)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
Grohdencommented, Dec 19, 2020

@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 https://github.com/Grohden/openapi-generator/commit/72c8e1531198e595e116d811173d2f2a6d558983, 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

1reaction
kuhnroyalcommented, Dec 18, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[DART] Add null-safety for dart 2.12+ #8278 - GitHub
Starting with DART 2.12 dart packages support sound null-safety making ... We first need to ensure OAS3 nullable/required work correctly and ...
Read more >
Documentation for the dart Generator
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. true: Keep the old (incorrect) behaviour ...
Read more >
OpenAPI Specification - Version 3.0.3 - Swagger
Tooling which supports OAS 3.0 SHOULD be compatible with all OAS 3.0. ... is appended to the URL from the Server Object in...
Read more >
OAS 3.0 Full API Lifecycle Support with Anypoint Platform
Today, we are excited to announce the introduction of OpenAPI Specification 3.0 support across the full API lifecycle with Anypoint ...
Read more >
Accelerate Flutter development with OpenAPI and Dart code ...
Run Flutter app and the back-end service example. If you like the tutorial above and would like to try the full example with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found