Provides well-documented JSON schemas for WordPress PHP objects (like WP_Post, WP_Term, WP_User) and REST API responses (e.g., /wp/v2/posts). Version 4.70.1, updated for WordPress 7.0. Maintained by John Blackbourn; schemas also generate TypeScript definitions in the companion wp-types package. Differentiators: comprehensive, hand-maintained schemas covering both PHP objects and REST endpoints, with regular updates aligned to WordPress core releases.
npm install wp-json-schemasNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Validates a WordPress post object against the WP_Post JSON schema using Ajv, showing how to import schemas and use them for validation.
Check the WordPress version compatibility matrix; update the package when WordPress is upgraded.
Check the README for the list of pending schemas and avoid relying on those endpoints for validation.
Use ES module imports (import ... from 'wp-json-schemas') or switch to version 3.x if CJS is required.
npm install wp-json-schemas@4.70.1
Use ES module import syntax or downgrade to version 3.x with npm install wp-json-schemas@3
Provide all required properties as defined in the schema, or use Partial<WP_Post> for optional fields.
No dependency data recorded yet.