Giter Club home page Giter Club logo

Comments (3)

johnbillion avatar johnbillion commented on May 29, 2024 1

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.

kevinwhoffman avatar kevinwhoffman commented on May 29, 2024

@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.

johnbillion avatar johnbillion commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.