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

refactor: use JSON::MaybeXS instead of JSON::PP #10578

Merged
merged 6 commits into from
Jul 23, 2024
Merged

Conversation

stephanegigandet
Copy link
Contributor

In the past we had issues with the JSON::XS module, so we we switched to JSON::PP for safety.
Maybe things work better with Cpanel::JSON::XS, so trying to replace all instances with https://metacpan.org/pod/JSON::MaybeXS (which loads Cpan::JSON::XS or JSON::XS if present)

@stephanegigandet stephanegigandet requested a review from a team as a code owner July 22, 2024 13:38
@github-actions github-actions bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies MongoDB We have 2 mongodb collections: one for current products, and one for obsolete products 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling Data import WikiData We link taxonomies to Wikidata (& back) - https://wiki.openfoodfacts.org/Structured_Data/Wikidata 🕹️ Gamification 🖼️ Images 🧪 tests ✏️ Editing - Auto Suggest Providing autosuggest for taxonomized fields. Mostly used in editing scenarii 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels checkbot 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers Recent changes Implemented by @hangy - https://world.openfoodfacts.org/cgi/recent_changes.pl?&page=1&page_size=25 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🍬 How much sugar https://howmuchsugar.in/ - Mini game powered by Open Food Facts data GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. Display 👥 Users Attributes https://wiki.openfoodfacts.org/Product_Attributes Tags lang update all products exports Account deletion Enabling users to delete account while preserving accountability for edits 🔐 Auth Scanbot labels Jul 22, 2024
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

🤞

@stephanegigandet
Copy link
Contributor Author

One difference is that integers are changed from 0 and 4 to 0.0 and 4.0 in API results:

-   "ingredients_with_unspecified_percent_sum" : 100,
+   "ingredients_with_unspecified_percent_sum" : 100.0,

-            "fruits_vegetables_legumes" : 0,
+            "fruits_vegetables_legumes" : 0.0,

@github-actions github-actions bot added the 🌱 Eco-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products label Jul 23, 2024
Copy link

sonarcloud bot commented Jul 23, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account deletion Enabling users to delete account while preserving accountability for edits API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) Attributes https://wiki.openfoodfacts.org/Product_Attributes 🔐 Auth checkbot Countries Data import Display 🌱 Eco-Score https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products ✏️ Editing - Auto Suggest Providing autosuggest for taxonomized fields. Mostly used in editing scenarii exports file import 🕹️ Gamification GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🍬 How much sugar https://howmuchsugar.in/ - Mini game powered by Open Food Facts data 🖼️ Images 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🥗 Ingredients 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels lang 👮 Moderation MongoDB We have 2 mongodb collections: one for current products, and one for obsolete products multilingual products Numbers 🚦 Nutri-Score 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers Recent changes Implemented by @hangy - https://world.openfoodfacts.org/cgi/recent_changes.pl?&page=1&page_size=25 REDIS Scanbot 🔎 Search Stores Tags 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests 🌐 Translations update all products 👥 Users WikiData We link taxonomies to Wikidata (& back) - https://wiki.openfoodfacts.org/Structured_Data/Wikidata
Projects
Status: Done
Status: Done
Status: Done
Status: Done
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants