IGNF / road2

NodeJS routing server aggregating several popular routing engines (video presentation (french) : https://peertube.fr/w/75fwFoW2GP8tQSGLUXUpPP)
https://ignf.github.io/road2/
GNU General Public License v3.0
11 stars 3 forks source link

feat(swagger): use swagger-ui-express to display simple and administration api doc #85

Closed jmkerloch closed 11 months ago

jmkerloch commented 1 year ago

Simple and administration openapi are available.

related #84

azarz commented 12 months ago

I personally think that's a great way to display the API documentation. I will wait for @lgrd 's return to approve the PR.

jmkerloch commented 11 months ago

convert the YAMLs to JSONs, so it will avoid one dependency.

You mean replacing api.yaml to api.json ?

read the new JSONs during the init step of the each API

If the API is described with JSON file we can just use this file directly for swagger-ui-express:

var swaggerDocument = require('./api.json');
router.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
lgrd commented 11 months ago

@jmkerloch Yes, I think we could replace it. I've seen it could be a JSON => https://spec.openapis.org/oas/latest.html#format

For the init step, you have a init file where you can do what you need to prepare your data.