Comments (3)
I just realised the documentation isn't entirely clear because it doesn't state that WP_REST_API_Posts
is an array of WP_REST_API_Post
objects. I'll clarify that.
For REST API search results there should still be a singular schema that makes up the collection schema even though there's no concept of querying for a single search result.
from wp-json-schemas.
@johnbillion I've begun working on a PR to add schemas for search results from the /wp/v2/search
endpoint. I'm following the contributing guidelines and referencing the existing schemas for comparison. I noticed that other endpoints have schemas for both plural (e.g. WP_REST_API_Posts
) and singular (e.g. WP_REST_API_Post
) forms of the returned items.
I am wondering if my PR should include include both WP_REST_API_Search_Results
and WP_REST_API_Search_Result
or just one and not the other?
from wp-json-schemas.
Great! Thanks very much.
The plural schemas represent the complete response, which is an array of the singular schemas. You don't need to worry about the plural schema for now, it can be added once the singular schema is finished.
Let me know if you have any more questions.
from wp-json-schemas.
Related Issues (20)
- Optional properties in object raise compile error TS2411 HOT 8
- Fix the deployment action
- Add definition for enveloped REST API responses HOT 1
- Check the REST API schemas when the `edit` context is used
- Add definition for WP_Block
- Add a scheduled workflow to run tests against nightly
- Provide separate REST API schemas for CRUD and by context HOT 3
- Add definition for REST API root
- Add definition for REST API batch requests
- Add definition for REST API oembed requests
- Add definition for REST API site health requests
- Add a test for identifying new REST API routes HOT 1
- Add definition for REST API menus HOT 1
- Namespaced Schemas per Context HOT 3
- Version numbering strategy
- `mime_type` / `media_type` incorrect/missing for `WP_REST_API_Attachment` HOT 2
- Add a test for `WP_Taxonomy_Labels` and `WP_Post_Type_Labels`
- Add a test for `WP_Http_Status_Code`
- Update `WP_Post_Type_Name` and `WP_Taxonomy_Name`
- Add a test for the REST API revisions schema HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-json-schemas.