swagger-api / swagger-api/swagger-editor
Valid OpenAPI parameters with same name but different `in` are flagged as duplicates
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 9.5k
- Forks
- 2.4k
- Avg merge
- 17h 15m
- Merged PRs (30d)
- 18
Description
Swagger Editor appears to flag valid OpenAPI 3.0.1 parameters as duplicates when they share the same name but have different in values.
This appears to be a regression in the hosted editor.
OpenAPI defines parameter uniqueness by the combination of name and in, not by name alone.
Minimal spec:
openapi: 3.0.1
info:
title: Parameter uniqueness repro
version: 1.0.0
paths:
/orders/{orderId}:
get:
summary: Repro duplicate parameter validation
operationId: getOrder
parameters:
- name: orderId
in: path
required: true
schema:
type: string
- name: orderId
in: header
required: false
schema:
type: string
responses:
'200':
description: OK/
Expected behaviour:
No validation error.
The two parameters are unique because their OpenAPI identity is:
- orderId + path
- orderId + header
Actual behaviour:
Error reported: Name must be unique among all parameters
Spec reference:
OpenAPI 3.0.1 Operation Object says:
"A unique parameter is defined by a combination of a name and location."
** Environment **
Tool: editor.swagger.io
Swagger Editor version: current hosted version, observed after 22 May 2026
Browser: <Chrome/Edge/Safari + version>
OS:
OpenAPI version: 3.0.1
Problem caused:
This is problematic for specs where the same business identifier is passed both as a path parameter and as a header parameter. Renaming the header avoids the editor error, but the original spec appears valid per OpenAPI 3.0.1.
Renaming is not an option at this time as it affects existing heavily used API
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
Start by loading the minimal OpenAPI 3.0.1 specification in the hosted editor and trace the parameter uniqueness validation entry point. Confirm that parameters are compared by both name and in, and verify that the path and header examples no longer produce a duplicate error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100