feat: Taxonomy list-all endpoint + Term/TermQuery hierarchy support - #197
feat: Taxonomy list-all endpoint + Term/TermQuery hierarchy support#197OMpawar-21 wants to merge 4 commits into
Conversation
…port Brings v2-legacy's CDA Taxonomy/Term/TermQuery classes to parity with the newer Taxonomy Publishing feature set: adds Taxonomies().List<T>() for GET /taxonomies, Depth/IncludeBranch on Term and TermQuery, and Skip/Limit/IncludeCount pagination on TermQuery. Consolidates the previously-triplicated request-building/header-merge/error-parsing logic across Taxonomy/Term/TermQuery into a single Internals/TaxonomyRequestHelper, fixing a bug where GetHeader's local-header merge was never actually invoked. Also fixes Term.Locales/Ancestors/Descendants, which were reading the wrong JSON envelope key ($.locales/$.ancestors/$.descendants) instead of the CDA's actual $.terms wrapper - confirmed against the live API, where it silently returned the raw envelope instead of throwing for loosely-typed callers. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
…g parity Renames the previously-added Taxonomies().List<T>() (GET /taxonomies) to Find<T>(), matching the naming convention used by the TypeScript and Python Contentstack SDKs for "fetch all X" style calls. Note: since Taxonomy : Query and Taxonomies() returns Taxonomy, this new Find<T>() (marked `new`) hides the inherited Query.Find<T>() used by the entry-filter feature (Taxonomies().Above/Below/Exists(...).Find<Entry>()). Confirmed live: that call chain now hits GET /taxonomies instead of GET /taxonomies/entries, silently ignoring any Above/Below/Exists filters. TaxonomySupportTest.cs still passes because its assertions (try/catch-any- exception-as-pass, bare NotNull on success) aren't strict enough to catch the substitution - flagging this here since the test suite won't. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Summary
Taxonomies().Find<T>()for the previously-missingGET /taxonomies(list all published taxonomies) endpoint, bringing this branch to parity with the Taxonomy Publishing feature set added elsewhereDepth/IncludeBranchmodifiers toTermandTermQuery, andSkip/Limit/IncludeCountpagination toTermQuery.Taxonomy.Fetch<T>(),Term's methods, andTermQuery.Find<T>()into a singleInternals/TaxonomyRequestHelper. This also fixes a bug whereGetHeader's local-header merge existed but was never actually called from any live request path.Term.Locales<T>()/Ancestors<T>()/Descendants<T>(): they were reading the JSON envelope under$.locales/$.ancestors/$.descendants, but the live CDA actually wraps all three under$.terms. Confirmed directly against the API - this silently returned the wrong (whole-envelope) object for loosely-typed callers and threw for strictly-typed ones (e.g.JArray).Test plan
Contentstack.Core.Unit.Tests(TaxonomyUnitTests): 73/73 passing - covers every new modifier (chaining, param-set) via reflection intoUrlQueries, plus the movedGetHeader/GetContentstackErrortests now targetingTaxonomyRequestHelperdirectly, plus the renamedTaxonomy_Find_*tests.Contentstack.Core.Tests(TaxonomyLocalisationTest, live integration against the real test stack): 17/17 passing, including new tests forDepth/IncludeBranchon ancestor/descendant traversal (verified against a realaccessories→cases/chargersterm hierarchy) and the renamedFind<T>()list-all-taxonomies endpoint.Contentstack.Core.Tests(TaxonomySupportTest, entry-filter regression check): 28/28 passing, but see the callout above - this does not prove the entry-filter feature is unaffected, only that its own assertions don't catch the change.curlfor every envelope key ($.taxonomy,$.taxonomies,$.term,$.terms) to confirm correctness beyond what the existing loosely-typed tests would catch, and directly comparedGET /taxonomies/entriesvsGET /taxonomiesresponses to confirm the behavior-change callout above with real data.🤖 Generated with Claude Code