Make WordPress Core

Opened 2 years ago

Last modified 3 months ago

#53079 assigned defect (bug)

Rest API Json Schema is invalid

Reported by: bukowa's profile bukowa Owned by: rachelbaker's profile rachelbaker
Milestone: Awaiting Review Priority: low
Severity: trivial Version: 5.7.1
Component: REST API Keywords: reporter-feedback close
Focuses: docs, rest-api, coding-standards Cc:


Hello i tried to validate JSON SCHEMA using online validators from

Looks like the schema does not pass any validator. I would like to generate some client code in different languages but all of them says schema is invalid.

Overall i couldn't find a way to get the schema directly from wordpress documentation. After some googling i found out i have to call curl -X OPTIONS and then there's a nested 'schema' property.

Also the docs at are kinda missleading because for the 'content' it says 'object' - so that can be actually anything?

I would really like to work with wordpress and the REST API it provides but overall i find it pretty difficult.

Change History (3)

#1 @SergeyBiryukov
2 years ago

  • Component changed from HTTP API to REST API
  • Keywords needs-design needs-design-feedback removed

#2 @bukowa
2 years ago

I found out the OPTIONS is actually in the documenation at:

It says:

or via an OPTIONS request to any endpoint, allowing human- or machine-discovery of endpoint capabilities.

Is the format returned by that request following any standard beside the "schema" which is json-schema v4 ?

#3 @rachelbaker
3 months ago

  • Keywords reporter-feedback close added; needs-patch dev-feedback needs-testing needs-docs removed
  • Owner set to rachelbaker
  • Priority changed from normal to low
  • Severity changed from critical to trivial
  • Status changed from new to assigned

The WordPress REST API schema follows the JSON-schema draft 6 specification. I tested a few endpoint schemas with some online validators and they passed.

In addition to the OPTIONS request, you can view a site's schema and endpoint documentation via the /wp-json url path for any WordPress site and find the links to other registered endpoint schemas.

It is unclear the form of support you are seeking in this ticket. Can you share what was flagged as invalid and what error/validation output you receive?

Note: See TracTickets for help on using tickets.