Fix the Retrieve and Update sections of the deploy keys API page

What does this MR do and why?

In review of !254540 (merged), @narendran-kannan listed seven problems on the deploy keys API page that predate that MR. This fixes the two that are still open on master and can be fixed without touching a line !254540 (merged) changes.

"Retrieve a deploy key" requested key 11 while its example response returned key 1, the "Public key" the list examples on the page also show. The request now asks for key 1.

The "Update a deploy key" attribute table had no key_id row, although PUT /projects/:id/deploy_keys/:key_id requires it (requires :key_id in lib/api/deploy_keys.rb), as the "Retrieve a deploy key" and "Delete a deploy key" tables already show. While in that table I also added a note that the request needs at least one of can_push or title: the route declares at_least_one_of :title, :can_push, so a request with neither is refused with 400 Bad request, and the table marked both as optional with nothing to say so.

Of the other five, four were fixed on master by !256496 (merged): the stray \ and the expired_at parameter in the POST /deploy_keys example, the nested double quotes in four --data arguments, and the missing --url in the loop that adds a key to several projects. The fifth, an unlabelled example response in "List project deploy keys for user", is removed in !254540 (merged) itself, because that MR already edits the block and removing it here would conflict with it.

This MR and !254540 (merged) change different lines of the page, so they merge cleanly in either order and give the same result.

MR acceptance checklist

This change is documentation only. No endpoint, parameter or behavior changes. markdownlint-cli2 with the repository's configuration reports no issues on the page, Vale with the repository's styles reports nothing on the changed lines, and every JSON block on the page still parses.

Merge request reports

Loading
Loading