feat(API): add 422 response when branching is disabled for branch create #STRINGS-3030 - #1272
Closed
Phrase (phrase-bot) wants to merge 1 commit into
Closed
Phrase (phrase-bot) wants to merge 1 commit into
Phrase (phrase-bot) wants to merge 1 commit into
Conversation
…ate #STRINGS-3030
Contributor
API changelog (oasdiff)Doc-only edits (descriptions, examples) do not appear here. |
Sven Dunemann (forelabs)
deleted the
openapi-sync/strings-app-pr-18723
branch
September 15, 2026 14:04
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.
This PR was generated by the
openapi-applyagent in response to a/openapi-sync applyrequest onPhrase-Engineering/strings-app#18723.
What changed in the API
POST /api/v2/projects/{project_id}/branchesnow returns422 Unprocessable Entitywith a{ message: string }body when the project's "Enable Branching" setting is off. Previously the endpoint would proceed to create (and fully process) the branch regardless of that project setting. The new guard fires after authorization and before the branch is persisted.Source
Notes for reviewers
422response is already present in the spec via$ref: ../../responses.yaml#/422, which referencesschemas/errors.yaml#/errors(the validation errors array). The newbranching_not_enabledguard also returns422but usesrespond_with_error(...), which produces{ message: string }without anerrorsarray. Both paths resolve to the same422status code so the shared ref is accurate at the status level; reviewers should confirm whetherresponses.yaml#/422needs an addendum for the message-only variant, or whether the description added to the operation is sufficient.403response entry combines"$ref"with a siblingdescription:field; per OpenAPI semantics the$refreplaces the entire object and the sibling is silently ignored. This is a pre-existing issue in the file, not introduced by this PR.operationIdcorrected frombranch/createtobranches/create(plural resource name, per conventions).requestBodytitle updated frombranch/create/parameterstobranches/create/parametersaccordingly. These are convention fixes bundled with this update.make lint(swagger-cli validate + bundle + openapi-generator-cli validate) passed with no errors on the patched working tree.Opened automatically by the
openapi-applyagent. Review the spec changesagainst the linked strings-app PR; the agent does not vouch for correctness
beyond "the YAML parsed and the documented layout was followed."