Skip to content

Fix duplicate client-uuid path parameter in OpenAPI spec#46016

Merged
ahus1 merged 1 commit intokeycloak:mainfrom
zmotso:fix/openapi-duplicate-client-uuid-param
Feb 16, 2026
Merged

Fix duplicate client-uuid path parameter in OpenAPI spec#46016
ahus1 merged 1 commit intokeycloak:mainfrom
zmotso:fix/openapi-duplicate-client-uuid-param

Conversation

@zmotso
Copy link
Contributor

@zmotso zmotso commented Feb 4, 2026

Closes #46015

The endpoint GET /admin/realms/{realm}/clients/{client-uuid}/roles/{role-name}/composites/clients/{client-uuid} contains two path parameters with the same name {client-uuid}, which produces an invalid OpenAPI specification.

This breaks OpenAPI code generators like oapi-codegen that rely on unique parameter names per path.

Solution

Rename {client-uuid} to {targetClientUuid} in RoleContainerResource.java.

{clientUuid} is not sufficient because most code generators normalise {client-uuid} (from the parent path) to clientUuid as well, which would still produce a collision. {targetClientUuid} makes the semantics clear: it refers to the client whose roles are being queried as composites, not the client that owns the role.

Impact

This is a non-breaking change:

  • The actual URL path segment value doesn't change
  • Only the OpenAPI parameter name changes, making the spec valid

@zmotso zmotso requested a review from a team as a code owner February 4, 2026 14:30
@zmotso zmotso force-pushed the fix/openapi-duplicate-client-uuid-param branch from 62bd168 to 3a1dc02 Compare February 4, 2026 15:00
Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the PR @zmotso

Rename {client-uuid} to {targetClientUuid} in RoleContainerResource to
avoid duplicate parameter names when the resource is mounted under
ClientResource. {clientUuid} is not sufficient because code generators
normalise {client-uuid} from the parent path to clientUuid as well.

Closes keycloak#46015

Signed-off-by: Zorian Motso <zorianmotso@gmail.com>
@shawkins shawkins force-pushed the fix/openapi-duplicate-client-uuid-param branch from 3a1dc02 to 1ad5f17 Compare February 16, 2026 15:28
@ahus1 ahus1 enabled auto-merge (squash) February 16, 2026 15:29
@ahus1 ahus1 merged commit 8258fce into keycloak:main Feb 16, 2026
82 checks passed
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.

Duplicate {client-uuid} path parameter in OpenAPI spec

3 participants