-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat: 1055 - new experimental class "FlexibleProduct" #1056
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
Open
monsieurtanuki
wants to merge
6
commits into
openfoodfacts:master
Choose a base branch
from
monsieurtanuki:feat/1055
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New files: * `api_get_flexible_product.dart`: tests around the new class `FlexibleProduct`. * `flexible_map.dart`: (experimental) helper class around json and maps. * `flexible_product.dart`: (experimental) Product without predefined structure, relying mainly on the json. * `flexible_product_result.dart`: (experimental) API answer from a call to /api/v???/product/$barcode, in a flexible manner. * `flexible_search_result.dart`: (experimental) API answer from a call product search, in a flexible manner. Impacted files: * `language_helper.dart`: added 3 experimental methods for `FlexibleProduct` * `open_food_api_client.dart`: added 2 experimental methods for `FlexibleProduct` - `getFlexibleProductResult` and `searchFlexibleProducts` * `openfoodfacts.dart`: added the new 4 class files * `product_image.dart`: added an experimental method to compute the image URLs * `product_query_configurations.dart`: made it possible to call API get product method with a "double" API version number - and not only an "int" * `product_result_v3.dart`: minor refactoring * `product_result_v3.g.dart`: generated
@teolemon ping |
This was referenced Apr 16, 2025
ping |
ping |
Sorry @monsieurtanuki , underwater on non mobile things. I asked for a technical quick look from @PrimaelQuemerais @g123k (who also seem to be a little bit underwater). |
@teolemon For the record it is related to the app, cf. openfoodfacts/smooth-app#6502 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
This PR adds flexibility:
3.2
Product
before anything elseWith that PR we can easily accept new product fields and fields changing format, as we can just store the json regardless of the current or future product format.
Fixes bug(s)
Part of
Files
New files:
api_get_flexible_product.dart
: tests around the new classFlexibleProduct
.flexible_map.dart
: (experimental) helper class around json and maps.flexible_product.dart
: (experimental) Product without predefined structure, relying mainly on the json.flexible_product_result.dart
: (experimental) API answer from a call to /api/v???/product/$barcode, in a flexible manner.flexible_search_result.dart
: (experimental) API answer from a call product search, in a flexible manner.Impacted files:
language_helper.dart
: added 3 experimental methods forFlexibleProduct
open_food_api_client.dart
: added 2 experimental methods forFlexibleProduct
-getFlexibleProductResult
andsearchFlexibleProducts
openfoodfacts.dart
: added the new 4 class filesproduct_image.dart
: added an experimental method to compute the image URLsproduct_query_configurations.dart
: made it possible to call API get product method with a "double" API version number - and not only an "int"product_result_v3.dart
: minor refactoringproduct_result_v3.g.dart
: generated