Skip to content

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
mainfrom
openapi-sync/strings-app-pr-18723
Closed

Phrase (phrase-bot) wants to merge 1 commit into
mainfrom
openapi-sync/strings-app-pr-18723

Conversation

@phrase-bot

Copy link
Copy Markdown
Collaborator

This PR was generated by the openapi-apply agent in response to a
/openapi-sync apply request on
Phrase-Engineering/strings-app#18723.

What changed in the API

  • POST /api/v2/projects/{project_id}/branches now returns 422 Unprocessable Entity with 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

  • The 422 response is already present in the spec via $ref: ../../responses.yaml#/422, which references schemas/errors.yaml#/errors (the validation errors array). The new branching_not_enabled guard also returns 422 but uses respond_with_error(...), which produces { message: string } without an errors array. Both paths resolve to the same 422 status code so the shared ref is accurate at the status level; reviewers should confirm whether responses.yaml#/422 needs an addendum for the message-only variant, or whether the description added to the operation is sufficient.
  • Pre-existing 403 response entry combines "$ref" with a sibling description: field; per OpenAPI semantics the $ref replaces the entire object and the sibling is silently ignored. This is a pre-existing issue in the file, not introduced by this PR.
  • operationId corrected from branch/create to branches/create (plural resource name, per conventions). requestBody title updated from branch/create/parameters to branches/create/parameters accordingly. 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-apply agent. Review the spec changes
against the linked strings-app PR; the agent does not vouch for correctness
beyond "the YAML parsed and the documented layout was followed."

@github-actions

Copy link
Copy Markdown
Contributor

API changelog (oasdiff)

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

1 changes: 0 error, 0 warning, 1 info
info	[api-operation-id-removed] at base/doc/compiled.json
	in API POST /projects/{project_id}/branches
		api operation id `branch/create` removed and replaced with `branches/create`

@forelabs
Sven Dunemann (forelabs) deleted the openapi-sync/strings-app-pr-18723 branch September 15, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants