Skip to content

Fix ModernTaxonomyPicker term-store request headers - #2198

Merged
AJIXuMuK merged 1 commit into
v4-devfrom
user/aterentiev/taxonomy-picker-requests
Nov 16, 2026
Merged

AJIXuMuK merged 1 commit into
v4-devfrom
user/aterentiev/taxonomy-picker-requests

Conversation

@AJIXuMuK

Copy link
Copy Markdown
Collaborator
Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? N/A — reported during testing; no linked issue.

What's in this Pull Request?

Fix the v4 ModernTaxonomyPicker request headers for SharePoint /_api/v2.1/termstore and term-set metadata. The supplied HAR shows HTTP 500 responses with generalException: Value cannot be null or empty. Parameter name: version when requests send an empty OData-Version header. Direct browser navigation does not send that empty header.

  • Send OData-Version: 4.0 and plain JSON for v2.1 requests instead of an empty version and legacy odata=verbose JSON.
  • Preserve classic REST OData v3 headers, binary content types, explicit content-type overrides, and digest handling.
  • Add regression coverage for term-store and term-set metadata at both root and subsite URLs, plus unchanged classic/binary/custom request headers.
  • Correct the custom-action documentation example and explain the empty-version failure.

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 unrelated react/no-find-dom-node lint 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

  • You can delete this section when you are submitting the pull request.
  • Please update this PR information accordingly. We'll use this as part of our release notes in monthly communications.
  • Please target your PR to dev branch.

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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@AJIXuMuK
AJIXuMuK merged commit 762b1c7 into v4-dev Nov 16, 2026
2 of 3 checks passed
@AJIXuMuK
AJIXuMuK deleted the user/aterentiev/taxonomy-picker-requests branch November 16, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants