A light REST API designed for the Open Food Facts Folksonomy Engine.
The code is written in Python 3.x and uses FastAPI framework.
PostgreSQL is used as the backend database.
You should create unit tests for each new feature or API change (see test_main.py). To run tests just launch:
PYTHONASYNCIODEBUG=1 pytest tests/ folksonomy/
The PYTHONASYNCIODEBUG
is important to check we have no pending asyncio tasks that are not executed
(sign of a potential problem).
FastAPI is based on OpenAPI (previously known as Swagger) and JSON Schema. FastAPI allows to generate an OpenAPI document (JSON) that you can reuse in various services (to automatically generate client libraries for example). To generate an OpenAPI document you can either:
./generate_openapi_json.py