Re: [RFC] JSON Schema validation support
| From: | Alexandre Daubois | Date: | Wed, 23 Jul 2025 14:06:41 +0000 |
| Subject: | Re: [RFC] JSON Schema validation support | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128194@lists.php.net to get a copy of this message | ||
Hi Jakub
Le mer. 23 juil. 2025 à 15:33, Jakub Zelenka <bukka@php.net> a écrit :
>
> Hello,
>
> I would like introduce and open discussion for RFC proposing the addition of JSON Schema
> validation support to JSON extension:
>
> https://wiki.php.net/rfc/json_schema_validation
>
> If this is successful, it should be just the first for further improvements (see the future
> scope).
>
> Kind regards,
>
> Jakub
Thank you for proposing such a feature! I personally really like it
and would be glad to see this land into PHP.
I think it would be even more useful if JsonSchema offers more ways to
load a schema. Schemas are often either remotely stored or stored in a
file.
It would be great to add two new factory methods:
JsonSchema::fromUri() and JsonSchema::fromFile(). Maybe
JsonSchema::createFromString() should also be renamed to fromString()
to be consistent with the recent additions to XMLReader.
Best,
Alex