Skip to content

OpenAPI 3.x: Scope of API version in servers definition too course grained? #1421

Open
@marwey

Description

@marwey

Hi, I was building a few OpenAPI 3.0 yaml files each describing a couple of paths. All path definitions are at version 1.

My server object is defined similiar to that pattern:

servers:
 - url: https://development.gigantic-server.com/v1
  description: Development server
 - url: https://production.gigantic-server.com/v1
   description: Production server 

What if I decide to change the path definition and/or the implementation of a path in a way that makes it incompatible to version 1? I would need to define a version 2 path. But certainly only for that specific path - all others should stay at version 1.

However, my server definition from above would be useless since its scope is applied to all path.

I can think of some workarounds - like e.g. putting the version number as part of the path definition or defining another yaml spec that only includes the version 2 path - but they are not really elegant and will cause other problems.

What is best practice for this - I guess quite common - scenario?
What was the intention of the spec authors to provide the above servers pattern?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    metadatatags, info, license, contact, markdown usage, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions