Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-03 Thread Jakub Zelenka
On Fri, Mar 3, 2023 at 4:31 PM Larry Garfield wrote: > On Fri, Mar 3, 2023, at 6:19 AM, Jakub Zelenka wrote: > > > >> You mean using the version from the JSON string, and allowing an > >> override? Like this? > >> > >> > > It should never allow overriding the $schema as it would go against spec

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-03 Thread Larry Garfield
On Fri, Mar 3, 2023, at 1:49 PM, Rowan Tommins wrote: > On 3 March 2023 16:30:26 GMT, Larry Garfield wrote: > >>Class constants FTW. > > s/Class constants/enum/ > > :P Well yes, but if they're being used to just represent a string, rather than being their own value, actually no. :-) Though, I s

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-03 Thread Rowan Tommins
On 3 March 2023 16:30:26 GMT, Larry Garfield wrote: >Class constants FTW. s/Class constants/enum/ :P -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-03 Thread Larry Garfield
On Fri, Mar 3, 2023, at 6:19 AM, Jakub Zelenka wrote: >> You mean using the version from the JSON string, and allowing an >> override? Like this? >> >> > It should never allow overriding the $schema as it would go against spec so > this would be just default if $schema is not specified. Just the

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-03 Thread Jakub Zelenka
Hi, On Thu, Mar 2, 2023 at 8:30 PM Larry Garfield wrote: > On Thu, Mar 2, 2023, at 1:31 PM, Jakub Zelenka wrote: > > On Thu, Mar 2, 2023 at 5:53 PM Rowan Tommins > > wrote: > > > >> On Thu, 2 Mar 2023 at 12:34, Jakub Zelenka wrote: > >> > >> > It's possible that we might decide to stop support

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Larry Garfield
On Thu, Mar 2, 2023, at 1:31 PM, Jakub Zelenka wrote: > On Thu, Mar 2, 2023 at 5:53 PM Rowan Tommins > wrote: > >> On Thu, 2 Mar 2023 at 12:34, Jakub Zelenka wrote: >> >> > It's possible that we might decide to stop supporting some drafts if the >> > maintenance burden is too big and usage small

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Jakub Zelenka
On Thu, Mar 2, 2023 at 5:53 PM Rowan Tommins wrote: > On Thu, 2 Mar 2023 at 12:34, Jakub Zelenka wrote: > > > It's possible that we might decide to stop supporting some drafts if the > > maintenance burden is too big and usage small but I wouldn't see that as > > something that happens often. Bu

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Rowan Tommins
On Thu, 2 Mar 2023 at 12:34, Jakub Zelenka wrote: > It's possible that we might decide to stop supporting some drafts if the > maintenance burden is too big and usage small but I wouldn't see that as > something that happens often. But essentially you are right that there will > be minimum (draft

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Bruce Weirdan
On Thu, Mar 2, 2023 at 1:23 PM Jakub Zelenka wrote: > The schema version should be specified by $schema keyword Unfortunately, it's not what happens in the wild. Some schemas even forbid `$schema` (e.g. Composer's one). -- Best regards, Bruce Weirdan

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Jakub Zelenka
On Thu, Mar 2, 2023 at 5:11 PM Larry Garfield wrote: > On Thu, Mar 2, 2023, at 6:34 AM, Jakub Zelenka wrote: > > On Thu, Mar 2, 2023 at 12:00 PM Rowan Tommins > > wrote: > > > >> On Wed, 1 Mar 2023 at 11:44, juan carlos morales < > >> dev.juan.mora...@gmail.com> > >> wrote: > >> > >> > I am thin

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Larry Garfield
On Thu, Mar 2, 2023, at 6:34 AM, Jakub Zelenka wrote: > On Thu, Mar 2, 2023 at 12:00 PM Rowan Tommins > wrote: > >> On Wed, 1 Mar 2023 at 11:44, juan carlos morales < >> dev.juan.mora...@gmail.com> >> wrote: >> >> > I am thinking about enhancing this function to also be able to >> > validate again

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Jakub Zelenka
On Wed, Mar 1, 2023 at 5:05 PM Larry Garfield wrote: > On Wed, Mar 1, 2023, at 6:06 AM, Jakub Zelenka wrote: > > On Wed, Mar 1, 2023 at 11:44 AM juan carlos morales < > > dev.juan.mora...@gmail.com> wrote: > > > >> Hello Internals. > >> > >> I am thinking about improving the json_validate() funct

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Jakub Zelenka
On Thu, Mar 2, 2023 at 12:00 PM Rowan Tommins wrote: > On Wed, 1 Mar 2023 at 11:44, juan carlos morales < > dev.juan.mora...@gmail.com> > wrote: > > > I am thinking about enhancing this function to also be able to > > validate against a JSON SCHEMA, giving us something like this: > > > > json_val

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Rowan Tommins
On Wed, 1 Mar 2023 at 11:44, juan carlos morales wrote: > I am thinking about enhancing this function to also be able to > validate against a JSON SCHEMA, giving us something like this: > > json_validate(string $json, int $depth = 512, int $flags = 0, string > $json_schema = null): bool > Funct

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-02 Thread Robert Landers
On Wed, Mar 1, 2023 at 6:05 PM Larry Garfield wrote: > > On Wed, Mar 1, 2023, at 6:06 AM, Jakub Zelenka wrote: > > On Wed, Mar 1, 2023 at 11:44 AM juan carlos morales < > > dev.juan.mora...@gmail.com> wrote: > > > >> Hello Internals. > >> > >> I am thinking about improving the json_validate() func

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Larry Garfield
On Wed, Mar 1, 2023, at 6:06 AM, Jakub Zelenka wrote: > On Wed, Mar 1, 2023 at 11:44 AM juan carlos morales < > dev.juan.mora...@gmail.com> wrote: > >> Hello Internals. >> >> I am thinking about improving the json_validate() function developed >> for php 8.3. >> >> The actual descriptions goes like

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Deleu
On Wed, Mar 1, 2023, 12:02 PM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > Hi Deleu, > > śr., 1 mar 2023 o 16:54 Deleu napisał(a): > >> >> >> On Wed, Mar 1, 2023 at 9:36 AM Michał Marcin Brzuchalski < >> michal.brzuchal...@gmail.com> wrote: >> >>> >>> Do we really need this

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Michał Marcin Brzuchalski
Hi Deleu, śr., 1 mar 2023 o 16:54 Deleu napisał(a): > > > On Wed, Mar 1, 2023 at 9:36 AM Michał Marcin Brzuchalski < > michal.brzuchal...@gmail.com> wrote: > >> >> Do we really need this in core? What makes it less usable as an extension? >> >> Cheers, >> Michał Marcin Brzuchalski >> >> > >> > >

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Deleu
On Wed, Mar 1, 2023 at 9:36 AM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > > Do we really need this in core? What makes it less usable as an extension? > > Cheers, > Michał Marcin Brzuchalski > > > > Extensions are not easy to install and have a complex distribution system

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread juan carlos morales
Excellent Jakub, amazing, happy to know all this. Lets wait for your proposal. Good luck, make it happen! El mié, 1 mar 2023 a las 10:45, Jakub Zelenka () escribió: > > Hi, > > On Wed, Mar 1, 2023 at 1:36 PM Michał Marcin Brzuchalski > wrote: >> >> Hi Jakub >> >> śr., 1 mar 2023, 14:09 użytkown

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Jakub Zelenka
Hi, On Wed, Mar 1, 2023 at 1:36 PM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > Hi Jakub > > śr., 1 mar 2023, 14:09 użytkownik Jakub Zelenka napisał: > >> > >> > Question ... are you planning to incorporate this by enhancing >> > json_validate() ??? >> > >> >> Yes the plan

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Michał Marcin Brzuchalski
Hi Jakub śr., 1 mar 2023, 14:09 użytkownik Jakub Zelenka napisał: > > > > 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

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Jakub Zelenka
> > 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

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Flávio Heleno
On Wed, Mar 1, 2023 at 9:23 AM juan carlos morales < dev.juan.mora...@gmail.com> wrote: > Jakub, wow, great to know this. thanks for writting. > > Ok, then I will assume that this feature will come from you > sometime in future. > > Since json_validate() was announced ... I have being receivi

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread juan carlos morales
Jakub, wow, great to know this. thanks for writting. Ok, then I will assume that this feature will come from you sometime in future. Since json_validate() was announced ... I have being receiving messages (a lot) about providing the ability to use JSON SCHEMAS as well, hopefully we will have

Re: [PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread Jakub Zelenka
On Wed, Mar 1, 2023 at 11:44 AM juan carlos morales < dev.juan.mora...@gmail.com> wrote: > Hello Internals. > > I am thinking about improving the json_validate() function developed > for php 8.3. > > The actual descriptions goes like this: > > json_validate(string $json, int $depth = 512, int $fla

[PHP-DEV] RFC Idea - json_validate() validate schema

2023-03-01 Thread juan carlos morales
Hello Internals. I am thinking about improving the json_validate() function developed for php 8.3. The actual descriptions goes like this: json_validate(string $json, int $depth = 512, int $flags = 0): bool I am thinking about enhancing this function to also be able to validate against a JSON S