[wp-trac] [WordPress Trac] #56494: REST API: Fix and test rest_default_additional_properties_to_false

WordPress Trac noreply at wordpress.org
Fri Sep 30 09:20:57 UTC 2022


#56494: REST API: Fix and test rest_default_additional_properties_to_false
--------------------------------------+------------------------------
 Reporter:  anna.bansaghi             |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  REST API                  |     Version:  6.0.2
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by anna.bansaghi):

 = Tree defined by mutual recursion (MR Tree)

 This section is related to the Solution 1, and because it discards invalid
 nodes from traversal, it is enough to analyze valid schemas.

 In this section we expect that the schema is valid (and will add one more
 rule to this definition) if:
 - has `type`
 - has correct `type` (if it is `array` then it has `items`, and if it is
 `object` then it has some properties).


 Before supporting the keywords with `schemaArray` definition (`allOf`,
 `anyOf`, `oneOf`), the function ran on Trees.
 After supporting the keywords with `schemaArray` definition, the function
 runs on MR Trees.

 This is how I imagine these data structures:


 [[Image()]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56494#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list