Skip to content

feat(ipa): Disallow resetting to a default value for optional fields - #120

Merged
yelizhenden-mdb merged 2 commits into
mainfrom
CLOUDP-429869
Aug 5, 2026
Merged

feat(ipa): Disallow resetting to a default value for optional fields#120
yelizhenden-mdb merged 2 commits into
mainfrom
CLOUDP-429869

Conversation

@yelizhenden-mdb

@yelizhenden-mdb yelizhenden-mdb commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Assigning a server-side default in place of a client-omitted value is an anti-pattern. This PR removes every mention of resetting to a default.

@yelizhenden-mdb yelizhenden-mdb changed the title CLOUDP-429869 feat(ipa): Disallow resetting to a default value for optional fields Aug 5, 2026
@yelizhenden-mdb
yelizhenden-mdb marked this pull request as ready for review August 5, 2026 13:36
@yelizhenden-mdb
yelizhenden-mdb requested a review from a team as a code owner August 5, 2026 13:36
Comment thread ipa/general/0107.mdx
- Any fields not included in the request body **must** be unset
- If the client explicitly provides `null` for an optional field in the request,
the server **should** unset the field or reset it to its default value
the server **should** unset the field

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Q: What is preventing this one from being a must? boolean fields?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If it is a non-nullable field, it will not be possible to unset it but the server will return a validation error instead

@manupedrozo manupedrozo Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If it is a non-nullable field

Hmm, I would expect this rule to not apply in that case. What are IPA-compliant optional, non-nullable fields?

@yelizhenden-mdb
yelizhenden-mdb merged commit f018f8d into main Aug 5, 2026
10 of 11 checks passed
@yelizhenden-mdb
yelizhenden-mdb deleted the CLOUDP-429869 branch August 5, 2026 14:45
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.

3 participants