Skip to content

Instantly share code, notes, and snippets.

@ponelat
Created December 14, 2021 10:35
Show Gist options
  • Save ponelat/15762c0d7da58bec96fbac6030db31e9 to your computer and use it in GitHub Desktop.
Save ponelat/15762c0d7da58bec96fbac6030db31e9 to your computer and use it in GitHub Desktop.
Multiple basePath not a feature
swagger: "2.0"
info:
title: Multiple basePaths
version: 1.0.0
description: |
Multiple basePaths aren't a feature in OpenAPI 2.0 (fka Swagger 2.0).
A basePath only works if _all_ your endpoints have it in there.
If your endpoints don't all share a comman basePath, you should leave it as `/` or blank.
basePath: /
host: example.com
schemes:
- https
paths:
/base1/foo:
get:
responses:
'200':
description: ok
/base2/bar:
get:
responses:
'200':
description: ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment