feat: allow search v1 queries using /cgi/search.pl to ask for product results in v3 format (e.g. packagings) #7770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is needed for openfoodfacts-dart, in order to have only one packagings data model used by the new API v3 for reading and writing products, and the old search API v1.
openfoodfacts/openfoodfacts-dart#617 (comment)
I also replaced search_tests.t by a new search_v1.t that uses functions from APITest.pm
Note: the differences of types in the JSON tests are just in the tests, the actual API returns the right types. This is an issue with our test framework that I have not been able to solve yet.