You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.
Enums serialized via it's ordinal value will get sent in JSON notation as an integer. In piriti in the enum.vm template for the reader there is a check if the sent value is a string. So currently we cannot use enum ordinal serialization. Even if we tried to implement a converter it would not kick in, as it is only called after the string check.
We propose an extension to the enum.vm reader template like the following:
if it's not a string try to get the enum value via it's ordinal value
so something like this (beware, not syntax checked or tried)
Enums serialized via it's ordinal value will get sent in JSON notation as an integer. In piriti in the enum.vm template for the reader there is a check if the sent value is a string. So currently we cannot use enum ordinal serialization. Even if we tried to implement a converter it would not kick in, as it is only called after the string check.
We propose an extension to the enum.vm reader template like the following:
so something like this (beware, not syntax checked or tried)
would ensure the reader works out of the box with enums serialized as name and as ordinal without any need for configuration.
For the writer something similar, but with some new configuration switch.
The text was updated successfully, but these errors were encountered: