Repository navigation
Fix ModernTaxonomyPicker term-store request headers - #2198
Merged
Merged
Conversation
Send an explicit OData v4 version and plain JSON for v2.1 taxonomy requests instead of an empty version and legacy verbose JSON. Preserve classic REST request behavior and cover the metadata requests with regression tests. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the ModernTaxonomyPicker request-header fix.
No open issues 🎉
What changed in this PR
Fixes ModernTaxonomyPicker requests in the v4 REST transport by replacing empty OData version headers with 4.0 and using plain JSON for SharePoint v2.1 endpoints.
Changes:
- Updates v2.1 request headers while preserving classic REST headers, binary content types, explicit overrides, and digest handling.
- Adds regression coverage for root and subsite taxonomy metadata requests and existing request-header behavior.
- Corrects the custom-action documentation example and explains the empty-version failure.
| File | Description |
|---|---|
| libraries/spfx-controls-react/tests/services/SPTaxonomyService.test.ts | Tests term-store and term-set headers at root and subsite URLs. |
| libraries/spfx-controls-react/tests/services/SPRestClient.test.ts | Tests preservation of classic, binary, custom, and digest headers. |
| libraries/spfx-controls-react/src/services/SPRestClient.ts | Uses OData v4 and plain JSON headers for v2.1 requests. |
| common/docs/documentation/docs/controls/ModernTaxonomyPicker.md | Updates the example header and documents the empty-version failure. |
Review effort: Balanced
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.
What's in this Pull Request?
Fix the v4 ModernTaxonomyPicker request headers for SharePoint
/_api/v2.1/termstoreand term-set metadata. The supplied HAR shows HTTP 500 responses withgeneralException: Value cannot be null or empty. Parameter name: versionwhen requests send an emptyOData-Versionheader. Direct browser navigation does not send that empty header.OData-Version: 4.0and plain JSON for v2.1 requests instead of an empty version and legacyodata=verboseJSON.This targets v4-dev, where the v4 REST transport migration lives.
Validation:
cd libraries/spfx-controls-react && npm test -- --test-path-pattern 'tests/services/(SPRestClient|SPTaxonomyService).*test|tests/controls/modernTaxonomyPicker/' --disable-code-coverage— passed, 42 tests across 5 suites, including the Heft build. An existing unrelatedreact/no-find-dom-nodelint warning remains. Both new taxonomy header cases failed before the source fix. Code review found no significant issues.Live SharePoint retesting of the corrected requests is still pending; the supplied HAR confirms the original failure, while automated tests verify the corrected request construction.
Guidance