feat(API): improve delete /projects/{project_id}/screenshots/{id} documentation#1170
Open
Stephen Lumenta (sbl) wants to merge 2 commits into
Open
feat(API): improve delete /projects/{project_id}/screenshots/{id} documentation#1170Stephen Lumenta (sbl) wants to merge 2 commits into
Stephen Lumenta (sbl) wants to merge 2 commits into
Conversation
…umentation Sharper description explains the irreversibility of deletion, cascade side effects on screenshot markers, permission requirements (write scope, Manage role, Attachable Screenshots plan feature), and the hex-string shape of the id parameter. Response docs cover 204, 401, 403 (three distinct cases), 404, 422, and 429. Code samples updated with a branch query-parameter variant and explicit expected-response comments. Closes DEVEX-115
The compare-output CI job diffs the committed bundle against a fresh swagger-cli compile, so spec changes must ship the regenerated bundle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines
+18
to
+30
| **Pitfalls and constraints:** | ||
| - The `id` path parameter is the screenshot's string code (a 32-character hex | ||
| string such as `d2e056aa9e70b01121f41693e344f5ee`), not a numeric database ID. | ||
| - Requires the `write` OAuth scope. Calls with only a `read` scope receive 403. | ||
| - The requesting user must have Manage permission on the Screenshot resource in | ||
| the project. Project Translators and Reviewers without Manage permission | ||
| receive 403. | ||
| - The project must have the Attachable Screenshots feature enabled on the account | ||
| plan. Accounts without this feature receive 403. | ||
| - Deletion on a protected project is blocked; the policy enforces | ||
| `!project.protected?` before granting Manage access. | ||
| - If the screenshot code does not exist in the project, the loader raises | ||
| `ActiveRecord::RecordNotFound` and the endpoint returns 404. |
Collaborator
There was a problem hiding this comment.
- all ids are 32 character hex characters. this can be removed
- remove the code like examples
Comment on lines
+32
to
+36
| **Error codes:** Phrase Strings uses HTTP status codes as its machine-readable | ||
| error identifiers. No additional string error codes are returned. All error | ||
| responses include a `message` field and, where applicable, a `documentation_url` | ||
| field. Validation failure responses (422) additionally include an `errors` array | ||
| with per-field `resource`, `field`, and `message` entries. |
Collaborator
There was a problem hiding this comment.
not specific to this endpoint and can be removed
Comment on lines
+13
to
+14
| to the screenshot are removed as a cascade side effect. Translators who relied | ||
| on this screenshot for visual context will no longer see it. A `screenshots:delete` |
Collaborator
There was a problem hiding this comment.
"Translators who relied on this screenshot for visual context will no longer see it"
- overly verbose. once deleted it's clear users cannot see it
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}/screenshots/{id}: 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.