Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Duplicate operationId is not throwing errors #219

Open
who opened this issue May 26, 2015 · 4 comments
Open

Duplicate operationId is not throwing errors #219

who opened this issue May 26, 2015 · 4 comments
Labels

Comments

@who
Copy link

who commented May 26, 2015

According to the Swagger 2.0 spec, regarding operationId :

A friendly name for the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operation id to uniquely identify an operation.

However, a Swagger 2.0 spec with duplicate operationIds is not throwing an error via swagger-tools.

Here's a sample spec to repro the issue:

{
    "swagger": "2.0",
    "info": {
        "version": "0.0.0",
        "title": "Simple API"
    },
    "paths": {
        "/": {
            "get": {
                "operationId": "unoriginalOperationId",
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            },
            "post": {
                "operationId": "unoriginalOperationId",
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    }
}
@whitlockjc
Copy link
Member

Yup, I just filed a bug at the same time you did. I will close #220 as a duplicate of this one.

@whitlockjc
Copy link
Member

I had to reopen this since it broke backward compatibility. I will add this back when 1.0.0 is released.

@sdementen
Copy link

any news on this bug ?
this control on duplicate id is missing from a lot of swagger validators ... (except the one behind https://editor.swagger.io/)

@whitlockjc
Copy link
Member

This will not be released prior to 1.0.0, which itself might not be released due to this project being effectively deprecated, see #335.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants