Tatoeba / tatoeba2

Tatoeba is a platform whose purpose is to create a collaborative and open dataset of sentences and their translations.
https://tatoeba.org
GNU Affero General Public License v3.0
703 stars 132 forks source link

API documentation #3078

Closed jiru closed 5 months ago

jiru commented 1 year ago

This PR provides some nice documentation for API consumers.

The documentation is maintained as formatted annotations in code comment. The tool swagger-php extracts these annotations and produces a standard JSON OpenAPI spec file. This file is then used by OpenAPI Explorer to produce some nicely-formatted HTML documentation. I chose OpenAPI Explorer because as a web component it is easy to include in our own views.

Setup instructions

Dev

This branch is installed on https://api.dev.tatoeba.org/, you can check the result there. The OpenAPI spec file can be used by other documentation tools as well, for instance Elements.