Hi,
Can I give multiple base paths in swagger 2.0 ? Please help
Multiple basPaths is not allowed in Swagger. You can use / as your basePath (or don't specify it) and prepend your base paths to your paths:
---
swagger: '2.0'
info:
version: 0.0.0
title: Simple API
paths:
/b/foo:
get:
responses:
200:
description: OK
/a/bar:
get:
responses:
200:
description: OK
/a/baz:
get:
responses:
200:
description: OK
Why is that? It's not too uncommon to have something like:
/api/v1/xxx
/api/v2/xxx
Side by side.
Or:
/admin/api/xxx
/server/api/xxx
/other/api/xxx
Appears to be a regression from v1
As long as they are all on the same server, there's no problem representing those in 2.0 as well. The regression from previous version is the ability to describe locations on different hosts.
I m using swagger 2. 0 , i want to integrate multiple json files generated for every rest jar in my project. In 1.2 i used APIs attribute in swagger object to integrate multiple Json's. But in 2.0 i couldn't find it. If I follow the above suggestion i have to manually modify my json file before deploying if a new rest service included. Please suggest me how can I achieve this.
Most helpful comment
Why is that? It's not too uncommon to have something like:
/api/v1/xxx
/api/v2/xxx
Side by side.
Or:
/admin/api/xxx
/server/api/xxx
/other/api/xxx
Appears to be a regression from v1