feat(core): opt-in JSON-LD structured-data validation#138
Merged
Conversation
Adds checks.routes.structuredData. On 2xx routes it parses every application/ld+json block and emits SEO-JSONLD-INVALID (warning) when a block is not valid JSON, or SEO-JSONLD-MISSING (info) when a route has no structured data at all. Reuses the existing route-probe body read shared with soft-404 and canonical, so the body is fetched once and only when a body-level check is enabled. Off by default.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Adds
checks.routes.structuredData. On 2xx routes it parses everyapplication/ld+jsonblock and emits:SEO-JSONLD-INVALID(warning) when a block is not valid JSON.SEO-JSONLD-MISSING(info) when a route renders no structured data.Reuses the route-probe body read shared with soft-404 and canonical, so the body is fetched once and only when a body-level check is enabled.
Why
Malformed JSON-LD (often a template-interpolation bug) silently breaks rich results, and structured data is on the 2026 headless-SEO checklist. This completes the route-level SEO surface alongside canonical and OG.
Off by default
Like soft-404 and canonical, it reads response bodies, so it is opt-in. Presence is only info; the actionable signal is malformed JSON.
How verified
SEO-JSONLD-INVALID; valid block -> silent; no block ->SEO-JSONLD-MISSING(info).pnpm verifygreen (209 tests).Refs improvements/32.