Vibe.d - Custom serialization policy

Flying-Toast email at example.org
Wed Jun 26 19:06:48 UTC 2019


On Wednesday, 26 June 2019 at 18:54:05 UTC, Flying-Toast wrote:
> I am using vibe.d's serialization feature for a few classes.
>
> I have found that immutable/const fields are not serialized, 
> though it turns out this is intentional [1].
>
> In the GitHub issue [1], Sönke mentioned that a solution to 
> this would be to use a custom `Policy`. I tried to find 
> documentation on vibe's serialization policies, but I couldn't 
> find any.
>
> Could anyone point me to some documentation for serialization 
> policies, or explain how to create a policy that allows 
> serializing immutable fields (and how to use it with the Json 
> serializer)?
>
> [1](https://github.com/vibe-d/vibe.d/issues/1536)
>
> Thanks!

Also, how do I make the serializer ignore a single field?


More information about the Digitalmars-d mailing list