Re: RFC Idea - json_validate() validate schema
| From: | Jakub Zelenka | Date: | Wed, 01 Mar 2023 13:09:07 +0000 |
| Subject: | Re: RFC Idea - json_validate() validate schema | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119636@lists.php.net to get a copy of this message | ||
>
> Question ... are you planning to incorporate this by enhancing
> json_validate() ???
>
Yes the plan is to initially enhance json_decode and json_validate that
would get a new $schema argument . I plan to create a class for the
actually schema as it needs to be parsed to its own representation so it is
convenient to have it in the object. It could be also later created from
the different sources than just JSON string (e.g. assoc array / stdClass or
automatic generation from the class that I mentioned before) so it will be
better to have it in the class.
Regards
Jakub