fix(API): improve delete /projects/{project_id}/keys/{id}/key_links documentation#1193
Merged
Stephen Lumenta (sbl) merged 9 commits intoJun 25, 2026
Conversation
Contributor
API changelog (oasdiff)Doc-only edits (descriptions, examples) do not appear here. |
Apply the batch review conventions:
- Trim the scope/status sentence from the description (write-permission,
'returns 403 on a branch', 'returns 422 KEY_IS_NOT_LINKED'); the 403 and
422 responses already document these. Keep the main-project restriction
and the error-code-format note.
- Drop the 'Response (HTTP 200): {...}' trailer from the curl sample.
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#batch_destroy → errors_for)
confirms the 422 body is { message, errors: [{ resource, field, message }] }
with NO code field. The custom 422 here invented a machine-readable
UPPER_SNAKE_CASE `code` field (KEY_IS_NOT_LINKED, CREATING_OR_UPDATING_
TRANSLATION_ERROR) that the API does not emit. Replace the custom body with
the shared $ref (which already documents the real envelope) and move the
genuine cause to the operation description, without inventing codes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s-from-a-parent-key
…s-from-a-parent-key
jablan
requested changes
Jun 25, 2026
Address @jablan's review: the 200 response inlined a full `linked_keys_reference` object that duplicated the existing `schemas/key_link.yaml#/key_link` model. The batch-unlink response is the same linked-key-group resource that create and list already return, so reference the shared schema instead of restating its shape. The operation-level `example:` stays inline because it illustrates the operation-specific post-unlink state (the remaining children after a child is detached), which differs from the create example. 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
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>
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>
jablan
approved these changes
Jun 25, 2026
This was referenced Jun 25, 2026
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.
Improves the documentation for
delete /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