[wp-trac] [WordPress Trac] #56152: REST JSON schema "readonly" prop does not match capitalization of JSON Schema standard (which uses "readOnly")
WordPress Trac
noreply at wordpress.org
Mon Sep 12 04:21:23 UTC 2022
#56152: REST JSON schema "readonly" prop does not match capitalization of JSON
Schema standard (which uses "readOnly")
--------------------------+-------------------------
Reporter: zebulan | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: REST API | Version: 4.7
Severity: normal | Resolution: maybelater
Keywords: | Focuses: rest-api
--------------------------+-------------------------
Comment (by zebulan):
I think simply supporting `readOnly` would help a lot in cases where you
use a 3rd-party PHP library that works with JSON schemas. For example:
I've been trying to share/standardize types between my PHP and TypeScript
code in a WP plugin project I've been working on. I figured it would make
the most sense to define schemas in JSON files imported in both sides of
the code, using something like https://github.com/bcherny/json-schema-to-
typescript ...unfortunately, WP doesn't actually use standard JSON schema,
so to do something like this, you have to pass the schema through a
converter.
I was hoping that between this ticket and a future solution to
https://core.trac.wordpress.org/ticket/51757#comment:5, we could gradually
push WP in the direction of actually complying with a subset of the JSON
schema specification.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56152#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list