-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
[RFC] Support for Open Food Facts variants #69
Comments
@teolemon I've just had a look at the names of the files in OFF-dart: the vast majority is definitely about food (for human beings). |
@teolemon We now have a /// Type of Server (e.g. "food facts", "beauty facts", ...).
enum ServerType implements OffTagged {
/// Open Food Facts
openFoodFacts(offTag: 'off'),
/// Open Beauty Facts
openBeautyFacts(offTag: 'obf'),
/// Open Pet Food Facts
openPetFoodFacts(offTag: 'opff'),
/// Open Product Facts
openProductFacts(offTag: 'opf');
const ServerType({
required this.offTag,
});
@override
final String offTag;
} In off-dart this is how we compute the URLs: host: OpenFoodAPIConfiguration.getQueryType(queryType) == QueryType.PROD
? OpenFoodAPIConfiguration.uriProdHost // for the moment, 'world.openfoodfacts.org'
: OpenFoodAPIConfiguration.uriTestHost, // for the moment, 'world.openfoodfacts.net' We could add a I don't think it makes much sense maintaining two variables for the host (
That would mean a (minor) breaking change. |
Actually we can already point to open beauty facts today by changing |
@monsieurtanuki I believe we can close this |
@teolemon As long as products have the same structure in all servers, yes we can. |
Request for comments:
Is there any way to add support for Open Food Facts variants such as ?
Is there a way to do it that would not break existing apps ? Or would we need to clone the package ?
The text was updated successfully, but these errors were encountered: