cancel
Showing results for 
Search instead for 
Did you mean: 

Linking to custom documentation file

SOLVED
Dimkanp
New Contributor

Linking to custom documentation file

Hello! I'm looking for answer for my problem: how to link to documentation from custom file?
I run the swagger ui docker instance using this command 'docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo swaggerapi/swagger-ui' and add some other documentation files next to the swagger.json, so I can switch between them on the site but I can't create link that opens additional file with documentation. Is exists any way to do that? Any path variable like this ip:port/#/users/search?documentation=/doc_v2.json ?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Dimkanp
New Contributor

Re: Linking to custom documentation file

Solution:
Using URLS environment variable gives opportunity to chose documentation file from drop down menu on the site and path to the request changed.


Env variable passed to docker:
URLS=[{url:'./swagger.json',name:'stable'},{url:'./develop.json',name:'develop'}]

 

Url to the request defined in non default documentation file:
ip:port/?urls.primaryName=develop#/users/search

Documentation: Swagger Documentation 

View solution in original post

1 REPLY 1
Dimkanp
New Contributor

Re: Linking to custom documentation file

Solution:
Using URLS environment variable gives opportunity to chose documentation file from drop down menu on the site and path to the request changed.


Env variable passed to docker:
URLS=[{url:'./swagger.json',name:'stable'},{url:'./develop.json',name:'develop'}]

 

Url to the request defined in non default documentation file:
ip:port/?urls.primaryName=develop#/users/search

Documentation: Swagger Documentation 

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors