rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

Is there any way to pass url variables to schema? #132

Closed Gildo-Sargi-Neto closed 4 years ago

Gildo-Sargi-Neto commented 4 years ago

I'm trying to pass URL to my schemas thru a variable like in the image below, isn't there any way to do this? If some day we change the base url we would have to change all the project this would be very inconvenient, i hope there is a solution for this problem :)

image image

mrin9 commented 4 years ago

I am not sure if I get your question correctly, but Open-API spec dont allow having variables in schema

However for servers the spec do allow having variables. Some call them as Server Templating

RapiDoc supports server-templating check out this example which demonstrate this https://mrin9.github.io/RapiDoc/examples/server-vars.html

the open-api spec for the above example is here https://github.com/mrin9/RapiDoc/blob/master/docs/specs/server.yaml