You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, it seems like there might be some inconsistency in the OpenFoodFact API. When I call saveProduct and provide the product object with lang: OpenFoodFactsLanguage.FRENCH and countries: OpenFoodFactsCountry.FRANCE.offTag, I would expect the API to save this information in the FRENCH field.
This means that if I subsequently call model.ingredientsTextInLanguages?[OpenFoodFactsLanguage.FRENCH], it should return the value I provided.
However, it appears that it saves the information in the OpenFoodFactsLanguage.ENGLISH field instead.
To make it work as expected, I also need to pass the parameters language: OpenFoodFactsLanguage.FRENCH and country: OpenFoodFactsCountry.FRANCE to the saveProduct function.
Ultimately, I understand that I don't need to specify a language and country on the Product object, so i've removed it.
Perhaps it would be a good idea to create another dedicated class or implementation for the saveProduct function and not manipulate Product object ?
We could (should?) remove the duplicate field but I think in addition the server side should fill those fields respectively if one of those is missing. Or am I missing something
The text was updated successfully, but these errors were encountered:
@M123-dev More generally, the question is about read-only fields and the meaning of fields.
I believe lang is just the language used in the latest update. Not very useful, is it?
In that specific case, that would probably make sense to deprecate/remove lang.
A different solution would be to display warnings each time a non-null read-only field is saved, if relevant with the name of the related field that is read/write.
Description
A recommendation from a SDK user on Slack:
We could (should?) remove the duplicate field but I think in addition the server side should fill those fields respectively if one of those is missing. Or am I missing something
The text was updated successfully, but these errors were encountered: