-
Notifications
You must be signed in to change notification settings - Fork 29
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
someOfs with many options are hard to create by hand #1508
Comments
Should we really treat this as a bug? |
I didn't know a better label, you can also remove it |
Let's consider this for the next release |
For the release that is coming up this week or for the release after that? If it is the latter then please add it after we have made the upcoming release. |
I'll try to draft an idea today. |
Ok My initial idea was to add a separate helper constructor to one of our extension methods that takes a dynamic value, switches over the runtimetype and assigns it to the right field(s). Should we move back to classes (needing to wrap every object)? |
I was thinking of a extension that adds a constructor that has all the fields, but set to null by default. Then it is very easy to add a single value and we wouldn't have a major rework and breaking change. |
There are two things to consider:
|
I'd be fine with calling the extension. |
Let's say it the other way. I do not think that it is even possible for records (at least not without a lot of hacks). |
Ok, then let's go with classes again? |
It would also be great to have good error messages for oneOf, because currently the error message doesn't help in debugging the problem. In case something goes wrong the serialization errors of all sub types should be displayed. |
An anyOf like
neon/packages/nextcloud/lib/src/api/core.openapi.dart
Line 9437 in 4490e77
The text was updated successfully, but these errors were encountered: