---
title: "Discussion on \"Mocking API Version Negotiation: Headers, Paths, Fallbacks\" | Hashnode"
description: "Discussion on \"Mocking API Version Negotiation: Headers, Paths, Fallbacks\". Version negotiation decides which contract the server answers with."
url: "https://hashnode.com/posts/mocking-api-version-negotiation/6af5f6b23fc81a591a868378"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Mocking API Version Negotiation: Headers, Paths, Fallbacks](https://blogs.powerduck.com/mocking-api-version-negotiation?utm_source=hashnode&utm_medium=feed)

Version negotiation decides which contract the server answers with.

Nov 12 · 5 min read · blogs.powerduck.com  
Read the article

-   [#api](https://hashnode.com/tag/api)
-   [#testing](https://hashnode.com/tag/testing)
-   [#programming](https://hashnode.com/tag/programming)
-   [#webdev](https://hashnode.com/tag/webdev)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses 1

Markdown supported · ⌘↵ to post

[OneLifeVibe](https://hashnode.com/@onelifevibe)

[Nov 12](https://hashnode.com/posts/mocking-api-version-negotiation/6af5f6b23fc81a591a868378/comment/6af60771c0c3340f77239a6b)

The branch table is the part I would keep coming back to. Most mocks I have seen cover the happy path version and skip the no version and unsupported version rows, which are exactly the cases that break a client in production when a server defaults or rejects. Including the deprecation and sunset headers on the v1 row is a good detail too, since a client that ignores those headers will keep working right up until the sunset date. The warning about the query parameter leaking into links and caches is also worth repeating to anyone choosing a mechanism.
