[wp-trac] [WordPress Trac] #38583: Support for objects in schema validation and sanitization
WordPress Trac
noreply at wordpress.org
Wed Oct 11 17:15:37 UTC 2017
#38583: Support for objects in schema validation and sanitization
---------------------------------------------------+-----------------------
Reporter: rachelbaker | Owner: rmccue
Type: enhancement | Status: reopened
Priority: high | Milestone: 4.9
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests dev-feedback | Focuses:
---------------------------------------------------+-----------------------
Comment (by TimothyBlynJacobs):
I strongly think that we should support `additionalProperties`. It, along
with `patternProperties` allows for very useful functionality. I
originally only included `additionalProperties` for the exact reason
@mnelson4 mentioned, `patternProperties` is something that could easily be
included later.
Additionally, if we want to whitelist object keys for use in things like
meta or settings, then it would be far more preferable to merge the
setting schema entry with defaults for the object data type that would
contain `'additionalProperties' => false`. This way custom endpoints would
work properly that already have `object` validation and you'd have the
increased "security" for settings or meta.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38583#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list