Tell an API caller what the user endpoints take - #737
Merged
Conversation
Every other family that has a help class answers a missing parameter with the list of parameters it accepts. The user endpoints had none, so the answer was 'Wrong parameters' and an empty detail: a caller was told something was wrong and left to guess which of eleven fields it was. A help class, wired the way the category, client, tag and group ones are, listing what create, edit, view, search and delete take and which are required — including the password create now asks for. The test that recorded the empty detail as the gap it was now asserts the answer names the parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
Every API family that has a help class answers a missing parameter with the list of parameters it accepts. The user endpoints had none — so the answer was
Wrong parameterswith an empty detail: a caller was told something was wrong and left to guess which of eleven fields it was.I recorded this in #693 as a gap rather than a defect. It is a gap that costs every API consumer the same hour, so here it is closed.
The change
A
UserHelpclass wired the wayCategoryHelp,ClientHelp,TagHelpandUserGroupHelpare, listing what create, edit, view, search and delete take and which are required — including the password that create now asks for (#693).Testing
The test that recorded the empty detail now asserts the answer names the parameters —
loginanduserGroupIdamong them.API integration tests: 226 green. PHPStan and PHPCS clean.
The rest of the family
Five more families still have no help class: auth tokens, notifications, profiles, the event log, custom fields and public links. Same gap, same fix, and worth doing — as its own change rather than bolted onto this one.