Skip to content

fix(API): improve get /projects/{project_id}/keys/{id}/key_links documentation#1188

Merged
Stephen Lumenta (sbl) merged 9 commits into
mainfrom
devex-116-linked-keys-list-child-keys-of-a-parent-key
Jul 1, 2026
Merged

fix(API): improve get /projects/{project_id}/keys/{id}/key_links documentation#1188
Stephen Lumenta (sbl) merged 9 commits into
mainfrom
devex-116-linked-keys-list-child-keys-of-a-parent-key

Conversation

@sbl

Copy link
Copy Markdown
Contributor

Improves the documentation for get /projects/{project_id}/keys/{id}/key_links: sharper descriptions, parameter docs, error responses, and usage examples.

Drafted with AI assistance and grounded in the API implementation. Please review for technical accuracy before merging; nothing is merged automatically.

🤖 Generated with Claude Code

@sbl Stephen Lumenta (sbl) added the developer-hub-api-quality API doc quality fix from the API Grader label Jun 15, 2026
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

API changelog (oasdiff)

Doc-only edits (descriptions, examples) do not appear here.

1 changes: 1 error, 0 warning, 0 info
error	[response-media-type-removed] at doc/compiled.json
	in API GET /projects/{project_id}/keys/{id}/key_links
		removed the media type `application/json` for the response with the status `400`

@sbl Stephen Lumenta (sbl) changed the title feat(API): improve get /projects/{project_id}/keys/{id}/key_links documentation fix(API): improve get /projects/{project_id}/keys/{id}/key_links documentation Jun 17, 2026
Stephen Lumenta (sbl) and others added 5 commits June 17, 2026 21:18
Apply the batch review conventions:
- Drop the scope/permission sentence ('Requires the translations:write
  scope ...') from the description; the 403 response already documents it.
- Remove the 'return a 400 response with error code key_not_a_parent'
  status sentence; the 400 response carries that detail. Keep the
  parent-key precondition and the error-code-format note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review feedback: error response descriptions should stay in the shared
responses.yaml for consistency, not be re-authored inline per operation.
Under OpenAPI 3.0 a description sibling of $ref is ignored anyway, so the
inline text never rendered. Strip the inline $ref-sibling response
descriptions (now bare $refs); the shared response owns the wording.
Genuinely custom (non-$ref) response bodies are left intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Source walk (strings-app linked_keys_controller#index) confirms the 400 for
a non-parent key renders a bare message ("Key <code> is not a parent key"),
not an object with a stable machine-readable code. The custom 400 here
invented a top-level `error` code field (key_not_a_parent) the API does not
emit, and the description claimed "Error codes use lowercase snake_case".
Replace the custom 400 with the shared $ref and keep the genuine cause (the
key is not a parent) in the operation description, without inventing codes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Strings convention: never hand-author Curl or CLI v2 samples. Mintlify
renders the request sample (curl + the multi-language playground) and the
response from the OpenAPI operation itself, so a hand-written x-code-samples
block drifts and overrides the correct auto-generated one; a CLI v2 sample
is not spec-derivable at all. Remove the block so Mintlify renders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sbl

Copy link
Copy Markdown
Contributor Author

API surface change — reviewer note

This PR replaces the inline 400 response (an ad-hoc {message} JSON schema) on GET /projects/{project_id}/keys/{id}/key_links with the shared $ref responses.yaml#/400, consistent with the repo-wide error-response consolidation. The shared component carries a description and headers but no body schema, so oasdiff flags response-media-type-removed for the application/json 400 body. This is the intended consolidation, not a behavioral change.

Applying breaking-change-approved to clear the gate.

@sbl Stephen Lumenta (sbl) added the breaking-change-approved Skip the oasdiff breaking-change gate: this PR intentionally changes the API surface label Jun 24, 2026
Stephen Lumenta (sbl) and others added 3 commits June 25, 2026 12:20
Apply the same dedup as #1192/#1193: the list response repeated a large inline
example on top of the `$ref` to `schemas/key_link.yaml#/key_link`. Move the
canonical example onto the shared schema and drop the inline copy, so every
key_links operation renders one example through the `$ref`.

Note: #1192 makes the identical addition to schemas/key_link.yaml; whichever of
the two merges second will see a trivial add/add conflict on that file — keep one
copy of the example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Regenerated from source with `swagger-cli bundle -t json -w 300 main.yaml`
(the exact command the lint/compare-output CI job runs), so the committed
bundle matches a fresh bundle of the deduped YAML. Fixes the compare-output
failure introduced by editing the source without rebundling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Stephen Lumenta (sbl) added a commit that referenced this pull request Jun 25, 2026
Follow-up to @jablan's review: referencing the schema was only half of it — the
200 response still carried a large inline example that overrode the `$ref` and
duplicated the shared model (with off-convention slug-style ids). Drop the inline
example and put the canonical one on `schemas/key_link.yaml`, matching #1192 and
#1188, so create, list, and batch unlink all render one example through the ref.

Rebundled doc/compiled.json from source.

Note: #1192 and #1188 make the identical addition to schemas/key_link.yaml;
whichever of the three merges first wins and the others get a trivial add/add
conflict on that file — keep one copy of the example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sbl Stephen Lumenta (sbl) merged commit 41ae4c9 into main Jul 1, 2026
13 checks passed
@sbl Stephen Lumenta (sbl) deleted the devex-116-linked-keys-list-child-keys-of-a-parent-key branch July 1, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change-approved Skip the oasdiff breaking-change gate: this PR intentionally changes the API surface developer-hub-api-quality API doc quality fix from the API Grader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants