open-api icon indicating copy to clipboard operation
open-api copied to clipboard

[documentation] "Getting started" very unclear on how to do multi-version APIs

Open denis-haskin-elemental opened this issue 3 years ago • 1 comments

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?

denis-haskin-elemental avatar May 12 '22 16:05 denis-haskin-elemental

if you have a good suggestion on how to make the docs clearer please submit a PR!

jsdevel avatar May 12 '22 23:05 jsdevel