Skip to content
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

Prevent Float value from automatically becoming BigDecimal when using Oj #68

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

kyoshidajp
Copy link
Contributor

Fixes #67

Only compat mode cat prevent automatically becoming BigDecimal when using oj.


# Prevent Float value from automatically becoming BigDecimal when using Oj
options = {}
options[:mode] = :compat if serializer.is_a?(Serializer::MultiJson) && defined?(::Oj)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a technical debt, but I couldn't figure out a better way.

@picandocodigo
Copy link
Member

Thank you very much for this fix @kyoshidajp. Could you add a test for the bug please? Something like the code you added to the very detailed issue you reported would be very useful. Thanks!

@kyoshidajp
Copy link
Contributor Author

@picandocodigo Thanks. I added a test.

@picandocodigo picandocodigo merged commit 8474e91 into elastic:main Sep 22, 2023
@picandocodigo
Copy link
Member

Thank you very much @kyoshidajp!

@kyoshidajp kyoshidajp deleted the add_compat_mode_for_oj branch September 22, 2023 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Float with many digits automatically becomes BigDecimal when using Oj
2 participants