On Wed, Jun 26, 2013 at 5:05 PM, Geraint <gerai...@gmail.com> wrote:
> This is to get around the situation where you want to mark something as not
> extendable (additionalProperties: false) but you still want to extend it,
> yes?
>
> As before, I'm against it on the principle that it's overly complicated -
> and I don't think that making it optional would actually help at all.
>
Let's face it: THE DEMAND IS THERE. And JSON Schema just has no
support for it at the moment.
As to "overly complicated", uhm. Read the draft ;) It is, on the
opposite, _very_ simple.
If it is the "optional" part which troubles you we can make it
compulsory instead... In fact, that is a better bet.
Now, what do other users think is the question. But I believe this
will be a HUGE bonus to JSON Schema.
The second one of those is the one that concerns me most. We will be dealing with a portion of a schema that (in terms of the actual document) does not really exist. Providing answers to simple questions like "where did the validation fail, and why?" suddenly become complicated to answer.
On Wed, Jun 26, 2013 at 5:32 PM, Geraint <gerai...@gmail.com> wrote:
[...]
>
> Whoah, capitals! :)
>
Sorry for that ;)
>
> If I understand correctly, the demand is there because people wish to
> override "additionalProperties":false, because they wish to ban "unknown"
> properties (for input to object-loaders in strictly-typed languages) but
> they then want to extend their previous schemas.
>
That is one scenario. But there are others.
Suppose you wish to reuse an existing schema, but want to add some
more properties to it, or alter the definition a little: refer to it,
patch it. As to...
> However, I feel that JSON Patch-Merge is an extremely heavyweight solution
> to this problem. It's not just implementing the merge (which I agree is
> fairly simple) - it's that:
>
> we require an extra pre-processing step - more processing time, more memory
> (the result of each merge is an independent copy)
Only if "merge" is there!
> the resuting JSON Schema produced by the merge has no definite URI - if it's
> a composite of two schemas from separate places in the document, what's the
> JSON Pointer fragment path?
>
To this, the answer is: "schema authors modifying external schemas by
the means of "merge" MUST ensure that the URI defining the location of
this schema, if any, differs from the original".
Basically, there should always be an "id" (by the way, when do we get
rid of fragment-only "id"s) in the merged schema if the original
schema has one.