Skip to content

Duplicate OperationIds should be considered invalid #181

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
charjr opened this issue Feb 21, 2023 · 0 comments · May be fixed by #192
Open

Duplicate OperationIds should be considered invalid #181

charjr opened this issue Feb 21, 2023 · 0 comments · May be fixed by #192

Comments

@charjr
Copy link

charjr commented Feb 21, 2023

Expected

Calling validate on a \cebe\openapi\spec\OpenApi object containing duplicate operationIds will return false.

Reasoning

OperationIds MUST be unique among all operations described in the API.

Actual

Calling validate on a \cebe\openapi\spec\OpenApi object containing duplicate operationIds returns true.

Example

$api = Reader::readFromJson(<<<JSON
{
  "openapi": "3.0.0",
  "info": {
    "title": "Test API",
    "version": "1.0.0"
  },
  "paths": {
    "/path": {
      "get": {
        "operationId": "op1",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "post": {
        "operationId": "op1",
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  }
}
JSON);

var_dump($api->validate()); // bool(true)
@Aribros Aribros linked a pull request Aug 1, 2023 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant