Open ericweidl opened 5 years ago
Have you thought about having two index entry points for public and private? It might be a bit more verbose that will work for sure:
#private index.yml
paths:
/foo:
$ref: ./foo/get.yaml
$ref: ./foo/post.yaml
/bar:
# ...
#public index.yml
paths:
/foo:
$ref: ./foo/get.yaml
/bar:
# ...
When I try that approach, I get a "duplicate key" error:
C:\...\npm\node_modules\multi-file-swagger\node_modules\js-yaml\lib\js-yaml\loader.js:171
throw generateError(state, message);
^
YAMLException: duplicated mapping key at line 61, column 5:
$ref: ./foo/post.yaml
^
The situation: my API has a public and a private version. The public version can basically only GET, the private version supports GET and POST.
My directory structure is:
I want to be able to create index files which only include the appropriate paths for the particular API.
For example, for the public version of my API, my root index would be something like:
And the index for the private version of my API would be something like:
The corresponding files would then contain:
/paths/index-public.yaml:
/paths/index-private.yaml:
I get a "duplicate key" error when I use multi-file-swagger to bundle the private API.
Can you give me any tips on how I can achieve my goal?