Re: [RFC] JSON Schema validation support
| From: | Valentin Udaltsov | Date: | Fri, 04 Jul 2025 21:49:38 +0000 |
| Subject: | Re: [RFC] JSON Schema validation support | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127883@lists.php.net to get a copy of this message | ||
On Sta, 5 July 2025 at 00:04, Jakub Zelenka <bukka@php.net> wrote:
> 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
>
Hi, Jakub!
I like the idea. I have a couple of initial thoughts:
1. Wouldn't it make sense to place all the new classes under the
Json
namespace, similar to how it’s done in ext-random?
2. If there’s no way to interact with the JsonSchema class, what purpose
does it serve? Wouldn’t it be simpler to just extend json_decode() with
an optional ?string $schema = null parameter?
--
Kind regards,
Valentin