Skip to content

Comments

Add validation for duplicate operationId values#32

Open
kreynolds wants to merge 1 commit intokevindew:mainfrom
kreynolds:fix-duplicate-operation-id
Open

Add validation for duplicate operationId values#32
kreynolds wants to merge 1 commit intokevindew:mainfrom
kreynolds:fix-duplicate-operation-id

Conversation

@kreynolds
Copy link

Summary

  • Adds validation to detect duplicate operationId values within the same OpenAPI document
  • operationId must be unique across all operations according to the OpenAPI specification

Test plan

  • Added test case verifying validation rejects duplicate operationId values
  • Added test case verifying unique operationId values are accepted
  • Added test case verifying operations without operationId are valid

This fix adds validation to detect when the same operationId is used
multiple times across different operations in the same OpenAPI document.
According to the OpenAPI specification, operationId should be unique
across all operations in a document.

The validation is implemented in the Paths factory validate method,
which collects all operationId values from all operations and reports
any duplicates found.

Changes:
- Added validate_operation_ids method to NodeFactory::Paths
- Added test cases for unique and duplicate operationId scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant