[PM-38935] - Moved MembersController to v2 Update. - #8281
Conversation
eliykat
left a comment
There was a problem hiding this comment.
No review required from me, looks straightforward.
…ents to get the benefits from new errors.
7860559 to
84a6d81
Compare
Do you think there will be an issue with adding the name and email to the request and changing the response to IResult instead of ActionResult? |
Have you checked if the output OpenAPI file is different? Curious if it'll impact https://bitwarden.com/help/api/ |
There was a problem hiding this comment.
Do you think there will be an issue with adding the name and email to the request
As long as they are optional (nullable) for backwards compatibility with existing consumers - that's OK. Your integration tests should assert this.
I've also suggested enabling the nullable context below so that this is clear in the code. (may apply to other files as well)
and changing the response to IResult instead of ActionResult?
In both cases I believe the openapi spec is generated based on the annotations (ProducesResponseType) so I don't think it'll have any effect, but as @sven-bitwarden said you can check the swaggerUI locally to see.
| @@ -2,8 +2,8 @@ | |||
| #nullable disable | |||
There was a problem hiding this comment.
Please remove this nullable directive and annotate any nullable fields accordingly.
| /// <summary> | ||
| /// The member's email address. Can only be changed for a claimed member without a master password when the | ||
| /// new address is on a domain verified by the organization. | ||
| /// </summary> | ||
| [StrictEmailAddressNullable] | ||
| [StringLength(256)] | ||
| public string Email { get; set; } | ||
|
|
||
| return existingUser; | ||
| } | ||
| /// <summary> | ||
| /// The member's name. Can only be changed for a claimed member. | ||
| /// </summary> | ||
| [StringLength(50)] | ||
| public string Name { get; set; } |
🎟️ Tracking
PM-38935
📔 Objective
Moved the MembersController to the v2
UpdateOrganizationUserCommand. Added the optional parameters for Name and Email. Also did some QoL improvements for the MembersController to take advantage of the new error message types.