Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

test(testing): add test to detect duplicate endpoint names #3908

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ThijsBroersen
Copy link
Contributor

@ThijsBroersen ThijsBroersen commented Jul 6, 2024

From my interpretation on the OpenAPI spec, operationId's (endpoint names), should be unique. This test shows it is currently not detected in the EndpointVerifier and when generating the OpenAPI spec it does not warn or fail on duplicate operationId's, it just generates it.

Shall I continue implement the test in the EndpointVerifier?

Should the OpenAPIDocsInterpreter throw an exception on duplicate names? Or perhaps add a toVerifiedOpenAPI: Either[OpenAPIError, OpenAPI] method to the interpreter and not allow e.g. duplicate operationId's?

Refs: https://softwaremill.community/t/duplicate-operationids/416/7

@adamw
Copy link
Member

adamw commented Jul 8, 2024

It's a good question on the error modes, there's one place current during the openapi interpreter where we throw exceptions. Not perfect, but introducing Eithers at this point might be confusing. So maybe we should indeed just perform the check in the interpreter itself.

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.

None yet

2 participants