OpenAPITools / OpenAPITools/openapi-diff

Adding a new optional property to the request/response body is considered backward incompatible.

Open
#264 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Breaking/Non-Breaking classification
Dominant language
Java
Stars
1.1k
Forks
190
PR merge metrics
No merged PRs in 30d

Description

Hi,
Why adding a new optional property (with default value) is considered to be an incompatible change?

  • V1 client sends a request without a new field - then the default value will be used by the V2 server - [OK]
  • V1 client receives the response from the V2 server with a new field - it will simply be ignored by the V1 client - [OK]

I really do not see why the diff tool reports it as an incompatible change?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the compatibility report with two minimal OpenAPI specifications: one with the original request/response body and one adding an optional property with a default value. Trace how the diff tool classifies that request and response change, then confirm the result against the expected backward-compatibility behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.