docs(API): document that locale code is not unique per project on POST /projects/{project_id}/locales - #1296
Merged
Conversation
… POST /projects/{project_id}/locales
The Strings model validates name uniqueness per project but does not
scope code uniqueness at all, so a second locale with a duplicate code
under a different name is created silently instead of erroring. Add a
note to the code and name field descriptions in
paths/locales/create.yaml so API integrators aren't surprised by this.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
API changelog (oasdiff)Doc-only edits (descriptions, examples) do not appear here. |
The compare-output CI check bundles main.yaml and diffs it against the committed doc/compiled.json. The previous commit updated the code/name descriptions in paths/locales/create.yaml but didn't regenerate this bundled artifact, causing the diff check to fail. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sven Dunemann (forelabs)
approved these changes
Sep 24, 2026
Sven Dunemann (forelabs)
requested review from
Sven Dunemann (forelabs)
and removed request for
Stephen Lumenta (sbl)
September 24, 2026 07:19
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.
Summary
paths/locales/create.yamldocumentednameandcodeas sibling required fields with no note on their uniqueness semantics. In the underlying Strings model (app/models/locale.rbinstrings-app),nameis validated unique per project (validates_uniqueness_of :name, scope: :project_id) butcodeis not scoped for uniqueness at all.codeunder a differentnamesucceeds silently, leaving the project with two live locales sharing one ISO code. Nothing in the spec warned a caller of this.codefield description to state that it is not unique per project — unlikename— and that creating a locale whosecodeduplicates an existing locale'scodewill succeed rather than error. Also clarified thenamefield description to state it must be unique per project, for contrast.Test plan
npx swagger-cli validate main.yaml— passesnpx swagger-cli bundle -t yaml -w 300 main.yaml > tmp/compiled.yaml— bundle succeeds and includes the updated description (confirms generated public API docs will reflect the change)npx openapi-generator-cli validate -i tmp/compiled.yaml— "No validation issues detected."Jira: STRINGS-3517
Co-Authored-By: junior-dev
🤖 Generated with Claude Code