ocket8888 commented on a change in pull request #3996: Rewrote /user/current to
Go
URL: https://github.com/apache/trafficcontrol/pull/3996#discussion_r337118816
##########
File path: docs/source/api/user_current.rst
##########
@@ -147,49 +150,99 @@ Request Structure
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
- Content-Length: 483
+ Content-Length: 465
Content-Type: application/json
{ "user": {
- "addressLine1": "not a real address",
- "addressLine2": "not a real address either",
- "city": "not a real city",
- "company": "not a real company",
- "country": "not a real country",
- "email": "[email protected]",
- "fullName": "Not a real fullName",
- "phoneNumber": "not a real phone number",
- "postalCode": "not a real postal code",
- "publicSshKey": "not a real ssh key",
- "stateOrProvince": "not a real state or province",
- "tenantId": 1,
+ "addressLine1": null,
Review comment:
In order for `PUT` to remain idempotent, all fields ought to be defined in
every request. We could treat missing fields as implicitly `null`, but that
introduces problems when you add fields to a request. Because old clients won't
know about new fields they'll `PUT` without them and accidentally set something
to `null`. The Perl acted as a `PATCH` by only updating the fields it found in
the request, but as that was breaking with the consistency of our API - and
seemingly RFC non-compliant - I elected to change the behavior.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services