-
Notifications
You must be signed in to change notification settings - Fork 61
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
Enum serialisation issue with V7 #861
Comments
@fredericDelaporte could you point me out what |
In our indexes data, we have properties typed as enums. That is our own business models enums. They were converted in the indexes as ints. Now, they are converted as strings. |
Additional consequences: we build the indexes with a .Net app but search them through JavaScript. So, JavaScript code expecting integers can not work. We have put converters on all our enum and enums array properties to get them serialized as int again. (Sure enough, string values are more descriptive than integers, but they are also more susceptible to breaking changes due to renaming, and they cause the data to be heavier. Anyway, my point is just to notify a breaking change which should be included in the upgrade guide.) |
Hello @fredericDelaporte Sorry for the late response. You are right, it's not an expected behaviour. We will publish a bug fix where the enum are persisted as |
A new minor version has been released ( Please note that your enum will be saved at |
Thanks. |
There is another breaking change about JSON serialization we have seen later: the
System.Text.Json
serialization is set in the Algolia client to convert enums to string, while previously, they were converted to integers.Since the Algolia client registers a global converter for doing this, it seems the only ways to adapt is either to set a custom converter on all enum properties of serialized models, or type the enum properties as
int
and adapt the code fetching them.Originally posted by @fredericDelaporte in #852 (comment)
The text was updated successfully, but these errors were encountered: