Forum Discussion

saumikdandapat's avatar
New Contributor
3 years ago

Multiple endpoints. No fixed server basepath. Trying to find a solution.

We have apis like this:

For dev and prod server we just need to change only the part of the endpoint in bold.


As you can see there are no fixed basepaths. All endpoints are different. So in swagger documentation, we cant have a specific server name due to that.
So each endpoint should go at path level but we should have the endpoints at path level but path names should be like this '/api/v1/dictionary' starting with /.
How do i use swagger to document my APIs in this case. Please help me find a solution to my problem. 


2 Replies

  • The Swagger spec supports overriding servers for a different path or operation level: see

    for this quote and an example:

    Overriding Servers
    The global servers array can be overridden on the path level or operation level. This is handy if some endpoints use a different server or base path than the rest of the API. Common examples are:
    • Different base URL for file upload and download operations,
    • Deprecated but still functional endpoints.


    • mhiggins's avatar

      Does this help:



        - description: Live servers
          url: 'https://{host}/v1'
                - ''
                - ''
                - ''
             default: ''