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

OBF OPF OPFF currently incompatible with api v3 #802

Closed
monsieurtanuki opened this issue Sep 9, 2023 · 0 comments · Fixed by #806
Closed

OBF OPF OPFF currently incompatible with api v3 #802

monsieurtanuki opened this issue Sep 9, 2023 · 0 comments · Fixed by #806
Labels
🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org

Comments

@monsieurtanuki
Copy link
Contributor

Problem

The main focus of Smoothie is currently OFF.
The next step is to explore OBF, OPF and OPFF too. Something like: "Hmm the barcode you've just scanned is not food, but pet food".
For that we need some consistency between OFF, OBF, OPF and OPFF.

The problem is that for OBF, even if we make an API V3 query, we get an old-fashioned API V1 result (https://world.openbeautyfacts.org/api/v3/product/3600550964738).
For instance, status is an int (and we expect a String? in API V3). And the packagings are different too.

Proposed solution

Possible solutions:

  1. just know that OBF, OPF and OPFF must be queried with an api version < 3
    => for that we would need to re-implement a now removed different getProduct method (V < 3) and maintain both methods. Not a lot of code, but possibly confusion for the users of the package.
  2. implement a different file for each source - open_food_api_client.dart, open_beauty_api_client.dart, ...
    => we would have to play it smart and not recopy all the code. Would a "beauty" product have the same fields as a "food" product anyway?
  3. ask the server to really implement api V3 for OBF OPF OPFF
    => minimum impact on openfoodfacts-dart. That still does not solve the possible differences between a "beauty" and a "food" product.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org
Development

Successfully merging a pull request may close this issue.

1 participant