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

docs: prevent collision in operation names in IdentityHub management API #288

Conversation

bscholtes1A
Copy link
Contributor

What this PR changes/adds

Prevent API operation name collision in merged OpenAPI file for Management API.

Why it does that

Some API Gateway such as Azure API Management does not support multiple API operations having the same name in the same openapi file.

Further notes

List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.

Linked Issue(s)

Closes # <-- insert Issue number if one exists

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@bscholtes1A bscholtes1A added the documentation Improvements or additions to documentation label Mar 4, 2024
@bscholtes1A bscholtes1A force-pushed the docs/fix_operation_name_collision_mgmt_api branch from 733589b to 69043ac Compare March 4, 2024 09:06
Copy link
Member

@paullatzelsperger paullatzelsperger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK with renaming method names, but I think the better approach here is to explicitly set the operationId on OpenApi annotations like so:

    @Tag(name = "KeyPairResources Management API")
    @Operation(description = "Finds a KeyPairResource by ID.",
            operationId = "findKeyPairResourceById", <-- ADD THIS
            responses = {
                    // responses
            }
    )
    KeyPairResource findById(String id, SecurityContext securityContext);

That way we can decouple method names from the API spec and we prevent subtle bugs in the future, that no-one detects until the API is actually published using Azure API GW.

We should do both, the method renaming and the explicit declaration.

@bscholtes1A bscholtes1A force-pushed the docs/fix_operation_name_collision_mgmt_api branch 2 times, most recently from 8571317 to 30c86ac Compare March 4, 2024 11:44
@bscholtes1A bscholtes1A force-pushed the docs/fix_operation_name_collision_mgmt_api branch from 30c86ac to 75a5fe8 Compare March 4, 2024 11:58
@bscholtes1A
Copy link
Contributor Author

I am OK with renaming method names, but I think the better approach here is to explicitly set the operationId on OpenApi annotations like so:

    @Tag(name = "KeyPairResources Management API")
    @Operation(description = "Finds a KeyPairResource by ID.",
            operationId = "findKeyPairResourceById", <-- ADD THIS
            responses = {
                    // responses
            }
    )
    KeyPairResource findById(String id, SecurityContext securityContext);

That way we can decouple method names from the API spec and we prevent subtle bugs in the future, that no-one detects until the API is actually published using Azure API GW.

We should do both, the method renaming and the explicit declaration.

updated

@bscholtes1A bscholtes1A changed the title docs: prevent collision in operation names in IdentityHub management aPI docs: prevent collision in operation names in IdentityHub management API Mar 4, 2024
@bscholtes1A bscholtes1A merged commit 64f68b2 into eclipse-edc:main Mar 4, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants