OpenAPITools / OpenAPITools/openapi-diff
Removing a Query parameter is considered a breaking change while removing a Request Body parameter isn't
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Description
While testing this tool, we've noticed that removing a query parameter would give a API changes broke backward compatibility result while removing a request body parameter would return a API changes are backward compatible. Shouldn't both be breaking changes?
If this is expected, we'd be curious to understand why that is.
Here are the spec files we used to test this:

old_queryparameter.yml :
openapi: "3.0.1"
info:
title: "Public Api"
description: ""
version: "2022-08-23T16:17:54Z"
servers:
- url: "https://someurl"
variables:
basePath:
default: "/v1"
paths:
/auth:
post:
parameters:
- name: "Username"
in: "query"
required: true
schema:
type: "string"
- name: "Password"
in: "query"
required: true
schema:
type: "string"
new_queryparameter.yml :
openapi: "3.0.1"
info:
title: "Public Api"
description: ""
version: "2022-08-23T16:17:54Z"
servers:
- url: "https://someurl"
variables:
basePath:
default: "/v1"
paths:
/auth:
post:
parameters:
- name: "Username"
in: "query"
required: true
schema:
type: "string"

old_requestbody.yml:
openapi: "3.0.1"
info:
title: "Public Api"
description: ""
version: "2022-08-23T16:17:54Z"
servers:
- url: "https://someurl"
variables:
basePath:
default: "/v1"
paths:
/auth:
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AuthRequest"
required: true
components:
schemas:
AuthRequest:
required:
- "Username"
- "Password"
type: "object"
properties:
Username:
type: "string"
Password:
type: "string"
new_requestbody.yml:
openapi: "3.0.1"
info:
title: "Public Api"
description: ""
version: "2022-08-23T16:17:54Z"
servers:
- url: "https://someurl"
variables:
basePath:
default: "/v1"
paths:
/auth:
post:
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AuthRequest"
required: true
components:
schemas:
AuthRequest:
required:
- "Username"
type: "object"
properties:
Username:
type: "string"
Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the comparison using old_queryparameter.yml/new_queryparameter.yml and old_requestbody.yml/new_requestbody.yml from the issue, then inspect the compatibility comparison entry points for query parameters and request-body schemas. Compare the reported results with the expected breaking-change behavior; check pull request #474 before starting because it is already open against this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100