Skip to content

Tell an API caller what the remaining endpoints take - #738

Open
blaipr wants to merge 1 commit into
mainfrom
feat/api-help-for-the-rest
Open

Tell an API caller what the remaining endpoints take#738
blaipr wants to merge 1 commit into
mainfrom
feat/api-help-for-the-rest

Conversation

@blaipr

@blaipr blaipr commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

The six API families that still had no help class — authorisations, notifications, profiles, the event log, custom fields and public links — answered a missing parameter with nothing but Wrong parameters. Each now names what it accepts and which of those it requires, as the account, category, client, tag, group and user families do.

Follows #737, which did the same for the user endpoints; this closes the gap rather than leaving five more instances of it.

Read, not assumed

Each list comes from its own controller. A help text that lies about what is required is worse than none, so three places where the source did not fit the pattern are handled explicitly:

  • an authorisation's password is genuinely optional (getParamRaw with no required flag — a token can be created with a null hash), so the help says optional;
  • a public link's typeId is fixed by the controller and is not a caller parameter at all, so it is left out entirely rather than documented as something to send;
  • public links have no edit endpoint, so there is no edit() help.

Testing

Each family's required-parameters test now asserts the answer names the parameters. The event log has none to assert — neither of its two actions requires anything — so it gets the help class and no test change.

API integration tests: 227 green. PHPStan and PHPCS clean.

One note on verifying this: the suite has to be run with nothing else touching the database. A first run reported five routing failures that vanished on a clean run — two processes were sharing the fixture database, not a real fault.

The six families that still had no help class — authorisations, notifications,
profiles, the event log, custom fields and public links — answered a missing
parameter with nothing but 'Wrong parameters'. Every family now names what it
accepts and which of those it requires, as the account, category, client, tag,
group and user ones do.

Each list is read off its own controller rather than assumed, because a help
text that lies about what is required is worse than none. Three places where
the source did not fit the pattern, and what was done about them: a token's
password is genuinely optional, so it says so; a public link's typeId is fixed
by the controller and is not a caller's parameter at all, so it is left out; and
public links have no edit endpoint, so there is no edit help.

Each family's required-parameters test now asserts the answer names the
parameters. The event log has none to assert — neither of its actions requires
anything.
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.

1 participant