[wp-trac] [WordPress Trac] #48818: REST API does not check nested required properties
WordPress Trac
noreply at wordpress.org
Fri Jan 3 17:08:27 UTC 2020
#48818: REST API does not check nested required properties
-------------------------------+------------------------------
Reporter: TimothyBlynJacobs | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.9
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------------+------------------------------
Comment (by TimothyBlynJacobs):
@circuitbit this is a great point. In WordPress we use v4 of the JSON
Schema ''except'' for `required` where we use the v3 syntax. This syntax
is nice to work with for core because we do a lot of conditional
adding/removing of properties as well as the addition of new properties
through things like additional properties and metadata. The simpler
boolean syntax allows the requiredness of the property to be entirely
communicated through one array definition instead of having to modify the
base schema.
That being said,. I do think supporting the array format would be quite
nice, particularly for cases where you are documenting a single `object`
property on a schema, as opposed to the schema for the entire resource. I
think we could add support for that syntax in the patch for this feature.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48818#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list