swagger-api / swagger-api/validator-badge

Validator should not accept files with duplicate operationIds

Open
#60 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation
Dominant language
Java
Stars
227
Forks
81
Avg merge
2h 3m
Merged PRs (30d)
1

Description

Hi,
The spec says that operationId values must be unique per API. But duplicate operationIds are accepted by the validator.

This short example passes validation, but shouldn't:
http://online.swagger.io/validator/debug?url=http://assetsdp.arx.com/larry/swagger/swagger_dup_ids.json

{"swagger": "2.0",
"x-foo" : "woof",
"info": { "version": "0.0.0", "title": "Simple API" },
"paths": { "/": { 
    "get": {"operationId": "duplicateID", "responses": { "200": { "description": "OK" }}},
    "put": {"operationId": "duplicateID", "responses": { "200": { "description": "OK" }}}
}}}

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 with the validator using the linked duplicate-operationId example and trace how operationId values are checked across the paths. Confirm the validator currently accepts the example, then make completion mean that duplicate operationId values produce a validation error while unique values remain accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.