When truly overwriting the current object, "required" is thrown away.
How can I specify another schema as /required/ without *writing* it
into the other schema's (Delivery.json) root?
On Sun, Jun 17, 2012 at 1:56 PM, Konstantin Käfer <kkae...@gmail.com> wrote:
> Hi,
> I noticed that in the current revision, 5.28 says about $ref: "it
> SHOULD replace the current schema with the schema referenced by the
> value's URI".
> When truly overwriting the current object, "required" is thrown away.
> How can I specify another schema as /required/ without *writing* it
> into the other schema's (Delivery.json) root?
This is one more motivation to change the definition of the "required" keyword!
As was already explained earlier, the "required" keyword has no role
in the schema is it attached to, it only makes sense to its containing
"properties". In draft v4, this keyword will change and your schema
will become:
Basically, it means that when validating a "properties" schema at the
moment, you have to lookup all "required" keywords in property schemas
to build the list of required properties for an object instance. With
draft v4 it will no longer be the case.
As such, "$ref" replacement doesn't really matter. But "required" as
defined in draft v3 is certainly confusing.
Hope this helps,
-- Francis Galiegue, fgalie...@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
On Sunday, June 17, 2012 3:38:21 PM UTC+2, fge wrote:
> On Sun, Jun 17, 2012 at 1:56 PM, Konstantin Käfer <kkae...@gmail.com> > wrote: > > Hi,
> > I noticed that in the current revision, 5.28 says about $ref: "it > > SHOULD replace the current schema with the schema referenced by the > > value's URI".
> > When truly overwriting the current object, "required" is thrown away. > > How can I specify another schema as /required/ without *writing* it > > into the other schema's (Delivery.json) root?
> This is one more motivation to change the definition of the "required" > keyword!
> As was already explained earlier, the "required" keyword has no role > in the schema is it attached to, it only makes sense to its containing > "properties". In draft v4, this keyword will change and your schema > will become:
> Basically, it means that when validating a "properties" schema at the > moment, you have to lookup all "required" keywords in property schemas > to build the list of required properties for an object instance. With > draft v4 it will no longer be the case.
> As such, "$ref" replacement doesn't really matter. But "required" as > defined in draft v3 is certainly confusing.
> Hope this helps, > -- > Francis Galiegue, fgalie...@gmail.com > "It seems obvious [...] that at least some 'business intelligence' > tools invest so much intelligence on the business side that they have > nothing left for generating SQL queries" (Stéphane Faroult, in "The > Art of SQL", ISBN 0-596-00894-5)
On Mon, Jun 18, 2012 at 12:13 PM, Konstantin Käfer <kkae...@gmail.com> wrote:
> Alright, thanks for confirming that I'm not misusing the property but that
> it's indeed a flaw in the spec.
Not only that, but draft v3 as such does not make any reference to the
JSON Reference spec[1]. It is scheduled for draft v4.
Now, I wish I had completed my work on my own implementation of Json
Schema earlier so that I fulfill a promise I have made earlier on the
list :/
[1] http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-02 -- Francis Galiegue, fgalie...@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
> I noticed that in the current revision, 5.28 says about $ref: "it
> SHOULD replace the current schema with the schema referenced by the
> value's URI".
> When truly overwriting the current object, "required" is thrown away.
> How can I specify another schema as /required/ without *writing* it
> into the other schema's (Delivery.json) root?
> On 17/06/12 12:56, Konstantin Käfer wrote:
> > Hi,
> > I noticed that in the current revision, 5.28 says about $ref: "it
> > SHOULD replace the current schema with the schema referenced by the
> > value's URI".
> > When truly overwriting the current object, "required" is thrown away.
> > How can I specify another schema as /required/ without *writing* it
> > into the other schema's (Delivery.json) root?
> > Konstantin
> --
> You received this message because you are subscribed to the Google Groups
> "JSON Schema" group.
> To post to this group, send email to json-schema@googlegroups.com.
> To unsubscribe from this group, send email to
> json-schema+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/json-schema?hl=en.