[WIP] `skip_serializing_if` assumes that object’s field may not exist
Goal
Closes #394
Changes
I've added parsing and handing of serde’s helper-attribute parameter skip_serializing_if.
Checklist
- [x] I have followed the steps listed in the Contributing guide.
- [x] If necessary, I have added documentation related to the changes made.
- [x] I have added or updated the tests related to the changes made.
This is intentionally not supported, see #204
I have re-opened this for now to let us experiment with the special-cases I outlined in #394 a bit. The two special-cases I'd like to play with first are
#[serde(skip_serializing_if = "<anything>", default)]
x: T // => x?: T
and
#[serde(skip_serializing, default)]
x: T // => x?: T
Hey @NyxCode, I see you marked the PR as [WIP] is there anything else you want to add before merging? If that's because of my commits, I was just resolving the merge conflict
@gustavo-shigueo Yeah, I think there are some open questions here still - and I couldn't find the "convert to draft" button ^^
Yeah, I think there are some open questions here still - and I couldn't find the "convert to draft" button ^^
Oh okay, lol
We could possibly emit an error/warning to prevent users from running into TS1257: A required element cannot follow an optional element. for tuple structs.
I have updated the description - I'd appreciate if you could take a look at this when you find some time @gustavo-shigueo. No hurry, tho.