-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow opting out of serialization #41
Comments
This reminded me of React's Taint API which usually raises an error when an expected (or in your words, marked) value is encountered during serialization. I did consider this before however there were three reasons why I didn't:
Now in your case it's a bit different since it doesn't exactly raise an error, it just omits the value. Usually my answer here would be to "defer this problem to the user by making the necessary changes manually" however this might be considered and can open as an opportunity. I like the idea of omitting, but I just need to have a decent API for this. Here's some of my ideas:
Now the term Also, as expected here, if the value is encountered, it's going to be replaced by a new value (by default it would be |
Thanks for looking into the issue! Between the ideas, I like the first and the third one, mostly because the second one requires creating a separate class. For the naming, I also can think of |
If possible, it'll be pretty convenient to mark some value to be not serialized. Imagine this arbitrary API:
In this case, without
NoSerialization
, theload
property should've filtered first not to make any serialization error, since anonymous functions are not serializable. However, because it's marked asNoSerialization
, Seroval can just skip the serialization and remove the property.The text was updated successfully, but these errors were encountered: