diff --git a/apis/cf/latest/components/requestBodies/RoleCreate.yaml b/apis/cf/latest/components/requestBodies/RoleCreate.yaml index 4c7b997..29abf2e 100644 --- a/apis/cf/latest/components/requestBodies/RoleCreate.yaml +++ b/apis/cf/latest/components/requestBodies/RoleCreate.yaml @@ -20,8 +20,7 @@ content: type: object properties: user: - $ref: '../schemas/RelationshipToOne.yaml' - description: A relationship to a user; the user can be defined by either a `guid` or, if the `set_roles_by_username` [feature_flag](#list-of-feature-flags) is enabled, a `username` (with the option of including an `origin` to disambiguate it) + $ref: '../schemas/UserRelationshipToOne.yaml' organization: $ref: '../schemas/RelationshipToOne.yaml' description: A relationship to an organization; required only when creating an organization role diff --git a/apis/cf/latest/components/schemas/Role.yaml b/apis/cf/latest/components/schemas/Role.yaml index fcbb6ed..f49bb3e 100644 --- a/apis/cf/latest/components/schemas/Role.yaml +++ b/apis/cf/latest/components/schemas/Role.yaml @@ -39,7 +39,7 @@ properties: A relationship to the space the role controls access to; when this is an organization role, `space.data` will be `null`. user: allOf: - - $ref: './RelationshipToOne.yaml' + - $ref: './UserRelationshipToOne.yaml' - description: | A relationship to the user; this is the user that has the role links: diff --git a/apis/cf/latest/components/schemas/UserRelationshipToOne.yaml b/apis/cf/latest/components/schemas/UserRelationshipToOne.yaml new file mode 100644 index 0000000..0cb4c8b --- /dev/null +++ b/apis/cf/latest/components/schemas/UserRelationshipToOne.yaml @@ -0,0 +1,31 @@ +type: [object, "null"] +properties: + data: + type: object + description: | + User relationship data that can be specified either by GUID or by username and origin. + When using username and origin, the set_roles_by_username feature flag must be enabled. + oneOf: + - type: object + properties: + guid: + type: string + format: uuid + description: The GUID of the user + required: + - guid + additionalProperties: false + - type: object + properties: + username: + type: string + description: The username of the user + origin: + type: string + description: The identity provider for the user (e.g., 'ldap', 'saml'). Optional field to disambiguate the username. + required: + - username + additionalProperties: false + description: | + User relationship data that can be specified either by GUID or by username and origin. + Set to null to clear the relationship. \ No newline at end of file diff --git a/apis/cf/latest/openapi.yaml b/apis/cf/latest/openapi.yaml index 296df2c..6a87a2a 100644 --- a/apis/cf/latest/openapi.yaml +++ b/apis/cf/latest/openapi.yaml @@ -107,7 +107,10 @@ components: $ref: './components/schemas/RelationshipToOne.yaml' RelationshipToMany: $ref: './components/schemas/RelationshipToMany.yaml' - + UserRelationshipToOne: + $ref: './components/schemas/UserRelationshipToOne.yaml' + IncludedResources: + $ref: './components/schemas/IncludedResources.yaml' Link: $ref: './components/schemas/Link.yaml' Pagination: