Closed JonasESmith closed 5 months ago
Thank you for submitting this very detailed report. Unfortunately, there are no workarounds I can apply for this case. serde
encodes Basic
as { "example": "Basic" }
and Basic()
as { "example": { "Basic": [] } }
. quicktype
fails to parse this specific case of an empty array in a union type despite this being valid JSON schema. This issue most likely stems from this comment within quicktype.
Moving forward, I have added error handling for quicktype errors and for when the expected output file is not found (similar to this case). I also added an option for --use-freezed
for dart, so you can now use Language::Dart { use_freezed: true }
. These changes should accessible in v0.1.1
via cargo update
. Thanks again for submitting this issue, and have a nice day :)
Code to reproduce
Error message
When navigating to
/Users/{...}/.cargo/registry/src/index.crates.io-6f17d22bba15001f/quick-type-schema-0.1.0/src/lib.rs:103:57
This is the line it points to
Solution
originally was the bellow, however wasn't outputting the correct enum in dart.