Handling endpoint versions in Open API

Viewed 44

I have a situation where I need to support two versions of an endpoint. The v1 of the endpoint has the same URL has v2. How the caller of the endpoint can switch between a v1 response and a v2 response is by the header they provide.

The v1 contact is:

GET - /users/{userId}
Header: application/json+v1

The v2 contact is:

GET - /users/{userId}
Header: application/json+v1

The question is: How can I document this in my OpenAPI documentation?

Do I need to have separate files for the different endpoints or can OpenAPI support two different versions of the same endpoint?

0 Answers
Related