Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusing the same paths defenitions for different versions of the docs #1

Open
Morgunov-Vitaly opened this issue Aug 12, 2020 · 0 comments

Comments

@Morgunov-Vitaly
Copy link

Hi!

Thanks for the boilerplate and for usefull article!
But how can I reuse the same paths defenitions for different versions of the docs with the only different schema or properties definitions?

Is there any way to use variables in $ref's of the paths defenitions? Or is it possible to use relative (internal) links within $ref descriptions of the paths defenitions that not binded with concrete shemas files?

I mean if I want to create different versions of the OpenApi documentation (for developers and public for ex.) and there are only differences in schemas elements descriptions for dev and public versions. Is it possible to change the $ref for example from "../schemas/Pet.yaml" to "#/components/schemas/Pet" in path defenition and then make two different files (/schemas/Pet-dev.yaml and /schemas/Pet-public.yaml) and two openapi-public.yaml and openapi-dev.yaml main files with different components/schemas $refs (' $ref: "./schemas/pet-open.yaml" and $ref: "./schemas/pet-dev.yaml" '). in theory it may give the possibility reuse the same paths defnitions for both dev and open docs.

Unfortunately for now $ref's with internal links, like "#/components/schemas/Pet" cause an error at the building of the final doc file. And using external links like "../schemas/Pet.yaml" in paths $refs makes hard binding paths defenition with schema defenition so it doesn't allow me to reuse path defenition for different version of the docs.
Could you give me the advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant