Skip to content

Search: Fix schema key content_type → type to match API response#3459

Merged
reakaleek merged 1 commit into
mainfrom
fix-search-schema-key
Jun 2, 2026
Merged

Search: Fix schema key content_type → type to match API response#3459
reakaleek merged 1 commit into
mainfrom
fix-search-schema-key

Conversation

@reakaleek

Copy link
Copy Markdown
Member

Why

The navigation-search API serializes NavigationSearchResultItem.Type with a CamelCase policy — the JSON key is type. A follow-up commit to the previous fix incorrectly renamed the Zod schema key from type to content_type, so SearchResponse.parse() failed on every result item in production.

What

Reverts the Zod schema key back to type in both useModalSearchQuery and useNavigationSearchQuery, and updates the test fixture to match.

The navigation-search API serializes NavigationSearchResultItem.Type as
"type" (CamelCase policy). The previous fix incorrectly renamed the Zod
key from "type" to "content_type", causing SearchResponse.parse() to
fail on every result item.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@reakaleek reakaleek requested a review from a team as a code owner June 2, 2026 19:53
@reakaleek reakaleek added the bug label Jun 2, 2026
@reakaleek reakaleek requested a review from cotti June 2, 2026 19:53
@reakaleek reakaleek temporarily deployed to integration-tests June 2, 2026 19:53 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@reakaleek, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 1 second. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c98a4fff-2a47-4fa6-bd9d-ae9b37b2b7e4

📥 Commits

Reviewing files that changed from the base of the PR and between ced14d0 and 74ee818.

📒 Files selected for processing (3)
  • src/Elastic.Documentation.Site/Assets/web-components/ModalSearch/useModalSearchQuery.ts
  • src/Elastic.Documentation.Site/Assets/web-components/NavigationSearch/NavigationSearchTelemetry.test.tsx
  • src/Elastic.Documentation.Site/Assets/web-components/NavigationSearch/useNavigationSearchQuery.ts
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix-search-schema-key

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@reakaleek reakaleek merged commit 84e18ad into main Jun 2, 2026
25 of 26 checks passed
@reakaleek reakaleek deleted the fix-search-schema-key branch June 2, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant