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

add description to user-risk-profile PATCH method #107

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build-scripts/transform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ main() {
elif . == "DirectoryGroupsService" then "Directory Groups"
else .
end' < $WATCHLISTS > $TMP && mv $TMP $WATCHLISTS
# set update-risk-profile PATCH description
jq '.paths[][] |=
if .operationId == "UpdateUserRiskProfile" then .description = {"$ref": "./api-descriptions/user_risk_profile_patch.rmd"}
else . end' < $WATCHLISTS > $TMP && mv $TMP $WATCHLISTS
}

main "$@"
21 changes: 21 additions & 0 deletions source/api/api-descriptions/user_risk_profile_patch.rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
HTTP PATCH methods support partially updating a resource. To accomplish this, each request must specify exactly which
fields are to be updated. This is commonly called the "field mask", and in this endpoint is provided by the `paths` query
param. Any keys in the request body that aren't in the field mask paths are ignored. This enables one to request an
object via a GET request, change the desired fields, then send back the same full object, without the possibility of
overwriting some other request that had happened in the meantime that had modified a different, unrelated field.

For example:

To update the `notes` and `endDate` fields for a user risk profile, make a `PATCH` request to
`/v1/user-risk-profiles/{user_id}?paths=notes,endDate` with a request body of:

```json
{
"notes": "note_update",
"endDate": {
"year": 2023,
"month": 3,
"day": 18
}
}
```
Loading