Call to implementors/users: how do _you_ use "id" and "$ref", if at all?

61 views
Skip to first unread message

Francis Galiegue

unread,
Sep 13, 2012, 12:32:02 PM9/13/12
to json-...@googlegroups.com
Hello,

There seems to be, as I expected, quite a lot of strife about these
two keywords. If you are interested, there is a discussion here:

https://github.com/json-schema/json-schema/issues/17

However, before you click the link above, I'd appreciate to have
_your_ usages of both of these keywords.

I'll start with my own:

* my (validation only) implementation has "$ref" support, with the
ability to add handlers for arbitrary URI schemes;
* it has loop detection support, dangling reference support etc;
* $ref resolution failures are always fatal errors;
* I use "id" in two situations:
* if a schema is loaded without a URI and has an "id" keyword at
the top level, I use this as the schema's URI _if and only if_ it is
an absolute URI and has no, or an empty, fragment;
* I use them as anchors in subschemas. This means, among other
things, that I _do not_ resolve "id" against the schema's URI.

And that's it.

How do you use it? In particular, do you use "id" for addressing
purposes? In what context?

Thank you all in advance,
--
Francis Galiegue, fgal...@gmail.com
JSON Schema: https://github.com/json-schema
"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)

Francis Galiegue

unread,
Sep 13, 2012, 12:50:26 PM9/13/12
to json-...@googlegroups.com
On Thu, Sep 13, 2012 at 6:32 PM, Francis Galiegue <fgal...@gmail.com> wrote:
> Hello,
>
> There seems to be, as I expected, quite a lot of strife about these
> two keywords. If you are interested, there is a discussion here:
>
> https://github.com/json-schema/json-schema/issues/17
>
> However, before you click the link above, I'd appreciate to have
> _your_ usages of both of these keywords.
>
> I'll start with my own:
>
> * my (validation only) implementation has "$ref" support, with the
> ability to add handlers for arbitrary URI schemes;
> * it has loop detection support, dangling reference support etc;
> * $ref resolution failures are always fatal errors;

Oh, I forgot to add: my implementation also has JSON Pointer support.

Francis Galiegue

unread,
Sep 15, 2012, 10:50:25 AM9/15/12
to json-...@googlegroups.com
OK, I was expecting more feedback :(

I'll just add this link to show what I, and others, consider wrong
with "id" as it is defined in draft v3. I'd like comments on the
provisions at the bottom of the page. Thanks!

https://github.com/json-schema/json-schema/wiki/The-%22id%22-conundrum
Reply all
Reply to author
Forward
0 new messages