-
Notifications
You must be signed in to change notification settings - Fork 284
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
Use of @optional attribute while serializing #1541
Comments
I think optional in and optional out must be separate. For example:
|
I believe non parameterized form will be little bit better: struct Foo
{
@optionalIn string bar;
@optionalOut string baz;
} because this |
static if (hasAttributeL!(OptionalAttribute, TA))
if (vt == typeof(vt).init) continue; |
Instead of (or additional to) annotation it's possible to make special rendering case for Nullable because it's close related. |
Made a PR for this. Not sure what to do with Nullable as mentioned by @crimaniak. |
Any news? |
There is #1650, which has a working implementation, but the API should still be improved (see my last comments). I'm not sure about the best naming scheme, though, which is why I didn't offer a suggestion yet, so any ideas would be welcome. |
Fixes vibe-d#1541 and is an alternative, simpler implementation of vibe-d#1650
Fixes vibe-d#1541 and is an alternative, simpler implementation of vibe-d#1650
Lets have this code:
It outputs:
It would be nice if the serializer wont serialize fields that has initial value and are marked as @optional.
So we can have just this at the output:
It could save a lot of data needed to be written to the output stream of REST API for example.
The text was updated successfully, but these errors were encountered: