open-api
open-api copied to clipboard
[documentation] "Getting started" very unclear on how to do multi-version APIs
https://www.npmjs.com/package/express-openapi#getting-started
The way the example files are named (./api-v1/api-doc.js, ./api-v1/paths/worlds.js, ./api-v1/services/worldsService.js) imply that to add a v2 version of the API, you'd have similar files ./api-v2/api-doc.js, etc).
But the initialization code seems to provide no way to add a v2 version of the API:
initialize({
app,
apiDoc: './api-v1/api-doc.yml',
dependencies: {
worldsService: v1WorldsService
},
paths: './api-v1/paths'
});
I'm trying to figure out how to do this (so far no other examples on the web yet) and once I do, I will submit a PR to update the documentation. Or perhaps someone could write a quick paragraph explaining how it would be done?
if you have a good suggestion on how to make the docs clearer please submit a PR!