Skip to content

docs(API): document that locale code is not unique per project on POST /projects/{project_id}/locales - #1296

Merged
Sven Dunemann (forelabs) merged 2 commits into
mainfrom
agent/STRINGS-3517-085e13
Sep 24, 2026
Merged

Sven Dunemann (forelabs) merged 2 commits into
mainfrom
agent/STRINGS-3517-085e13

Conversation

@junior-ai-bot

@junior-ai-bot junior-ai-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • paths/locales/create.yaml documented name and code as sibling required fields with no note on their uniqueness semantics. In the underlying Strings model (app/models/locale.rb in strings-app), name is validated unique per project (validates_uniqueness_of :name, scope: :project_id) but code is not scoped for uniqueness at all.
  • Creating a second locale with an already-present code under a different name succeeds silently, leaving the project with two live locales sharing one ISO code. Nothing in the spec warned a caller of this.
  • Updated the code field description to state that it is not unique per project — unlike name — and that creating a locale whose code duplicates an existing locale's code will succeed rather than error. Also clarified the name field description to state it must be unique per project, for contrast.

Test plan

  • npx swagger-cli validate main.yaml — passes
  • npx 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."
  • Docs-only spec change; no source/test files touched, so no test suite run beyond the above spec validation.

Jira: STRINGS-3517

Co-Authored-By: junior-dev
🤖 Generated with Claude Code

… 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>
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

API changelog (oasdiff)

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

No changes to report, but the specs are different.
Run 'oasdiff diff' to see structural differences.

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>
@junior-ai-bot junior-ai-bot Bot changed the title STRINGS-3517 - document that locale code is not unique per project on POST /projects/{project_id}/locales docs(API): document that locale code is not unique per project on POST /projects/{project_id}/locales Sep 24, 2026
@forelabs
Sven Dunemann (forelabs) merged commit 1bfb7a8 into main Sep 24, 2026
13 checks passed
@forelabs
Sven Dunemann (forelabs) deleted the agent/STRINGS-3517-085e13 branch September 24, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant