Repository navigation
feat(taxonomy): add publish and unlocalize - #227
Open
reeshika-h wants to merge 2 commits into
Open
reeshika-h wants to merge 2 commits into
reeshika-h wants to merge 2 commits into
Conversation
Publish posts a flat { locales, environments, items: [{ uid }] } body to
/taxonomies/publish. It is collection-level, so it is rejected on a
taxonomy bound to a uid, and the optional branch is sent only as a header.
The API only reports that the request was accepted, so the XML docs say a
2xx means accepted and point at the publish queue for the outcome.
Unlocalize deletes the taxonomy with a required locale. The locale is
checked after login and uid, and restricted to letters, digits, '-' and
'_' because query values are appended unencoded; without it a DELETE
removes the whole taxonomy. A Branch containing a control character is
rejected, since it would inject another header line.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
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.
Problem
The .NET management SDK can localize a taxonomy but has no call for the
"Publish taxonomies" API (
POST /v3/taxonomies/publish) and no explicit way tounlocalize one. The only route to removing a localized version was
Deletewith a hand-built
localequery parameter, and the sameDeletewithout itremoves the whole taxonomy, so a missing argument could silently destroy data.
Ticket: https://contentstack.atlassian.net/browse/DX-10479
Fix
Taxonomy.Publish/PublishAsync(TaxonomyPublishModel model, ...)post aflat
{ locales, environments, items: [{ uid }] }body to/taxonomies/publish(noapi_versionorscheduled_at, no payloadvalidation; a null item is sent as
{"uid":null}and left for the API toreject). The optional
Branchgoes only in thebranchheader. Publish iscollection-level: a uid-bound or
Taxonomy("")instance throwsInvalidOperationException. The XML docs say a 2xx means accepted, notcompleted, and point at the publish queue.
Taxonomy.Unlocalize/UnlocalizeAsync(string locale, ...)sendDELETE /taxonomies/{uid}?locale=…and return the 204 without parsing it.The locale is required and restricted to letters, digits,
-and_(query values are appended unencoded), so an unlocalize can never become a
whole-taxonomy delete. The checks run login, then uid, then locale, before
any request is sent.
Branchis rejected withArgumentExceptionif it contains a controlcharacter: a CR or LF there injected a second header line on the wire.
Non-ASCII values pass the guard and are refused by .NET at send time.
LocaleRequiredandBranchInvalid; existing methods,including
Localize, are unchanged.stack-level
BranchUidheader has the same injection; the uid goes intothe path unescaped (
Taxonomy("tx#").Unlocalize("en")becomes a delete of/taxonomies/tx); collection keys and values are appended unencoded.mutation-checked guard-order tests for
Publish, and six live-stack tests(
Test280–Test285) for publish and unlocalize. The live-stack tests havenot been run yet: they need a stack with environments, locales and a
mainbranch. Snyk did not run locally; CI's scan covers it.