Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

feat: [WIP] Robotoff documentation #30

Draft
wants to merge 37 commits into
base: develop
Choose a base branch
from

Conversation

teolemon
Copy link
Member

@teolemon teolemon commented Sep 13, 2021

Robotoff documentation. The non Robotoff docs have been copied to a new PR.

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@teolemon teolemon requested a review from ocervell September 13, 2021 16:08
Copy link
Contributor

@ocervell ocervell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things:

  • Use the already defined Postman variables, like DOMAIN_NAME, API_VERSION and PRODUCT_NUMBER. This makes it effectively easier to maintain the documentation over time, and switch between environments (.net, .org` etc...)

  • Add ROBOTOFF_API_VERSION = 1 variable to the two Postman environments (.net and .org JSON files)

  • Add INSIGHT_ID=9a320966-c1dd-4699-aea4-fe6f3bf953be variable to the two Postman environments (.net and .org JSON files)

  • Get a random insight URL should be https://robotoff.{{DOMAIN_NAME}}/api/v{{ROBOTOFF_API_VERSION}}/insights/random instead of .../questions/...

  • Get a specific insight URL should be filled (e.g: https://robotoff.{{DOMAIN_NAME}}/api/v{{ROBOTOFF_API_VERSION}}/insights/detail/{{INSIGHT_ID}}

  • Get all insights for a specific product URL can be set to https://robotoff.{{DOMAIN_NAME}}/api/v{{ROBOTOFF_API_VERSION}}/insights?barcode={{PRODUCT_NUMBER}} or https://robotoff.openfoodfacts.org/api/v1/insights/24094870 (not sure why the two work but they don't return the same number of fields, maybe explain this in the docs)

  • Get questions can be changed to Get random question and URL set to https://robotoff.{{DOMAIN_NAME}}/api/v{{ROBOTOFF_API_VERSION}}/questions/random

  • Get spelling corrections URL can be set to https://robotoff.{{DOMAIN_NAME}}/api/v{{ROBOTOFF_API_VERSION}}/predict/ingredients/spellcheck

For reference, here is the list of endpoint not documented yet (can be added in further PRs):

api.add_route("/api/v1/insights", InsightCollection())
api.add_route("/api/v1/insights/annotate", AnnotateInsightResource())
api.add_route("/api/v1/predict/nutrient", NutrientPredictorResource())
api.add_route("/api/v1/predict/ocr_insights", OCRInsightsPredictorResource())
api.add_route("/api/v1/predict/category", CategoryPredictorResource())
api.add_route("/api/v1/products/dataset", UpdateDatasetResource())
api.add_route("/api/v1/webhook/product", WebhookProductResource())
api.add_route("/api/v1/images/import", ImageImporterResource())
api.add_route("/api/v1/images/crop", ImageCropResource())
api.add_route("/api/v1/images/predictions/import", ImagePredictionImporterResource())
api.add_route("/api/v1/images/predictions", ImagePredictionFetchResource())
api.add_route("/api/v1/images/predict", ImagePredictorResource())
api.add_route("/api/v1/images/logos", ImageLogoResource())
api.add_route("/api/v1/images/logos/{logo_id:int}", ImageLogoDetailResource())
api.add_route("/api/v1/images/logos/annotate", ImageLogoAnnotateResource())
api.add_route("/api/v1/images/logos/update", ImageLogoUpdateResource())
api.add_route("/api/v1/status", StatusResource())
api.add_route("/api/v1/dump", DumpResource())
api.add_route("/api/v1/users/statistics/{username}", UserStatisticsResource())

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@github-actions
Copy link

Staging documentation deployed to https://openfoodfacts.github.io/api-documentation-staging

@teolemon teolemon marked this pull request as draft September 20, 2021 08:35
@teolemon teolemon changed the title Update off-pm-collection.json [WIP] Robotoff documentation Sep 20, 2021
@teolemon teolemon changed the title [WIP] Robotoff documentation feat: [WIP] Robotoff documentation Sep 25, 2021
@teolemon teolemon added the enhancement New feature or request label Feb 4, 2022
@teolemon teolemon self-assigned this May 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants