Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"uritemplate" and "jsonpointer" formats #150

Merged
merged 1 commit into from
Dec 4, 2016

Conversation

handrews
Copy link
Contributor

Addresses issue #109 by adding "uritemplate" and "jsonpointer",
as defined by their RFCs, both of which already play roles
within JSON (Hyper-)Schema.

We use "uritemplate" in hyper-schema, but until the preprocessing
step is removed we technically can't put the format in the
meta-hyperschema. This is being addressed elsewhere
(#142 and #129 propose one possible approach).

While we do not need "jsonpointer" for our meta-schema, it is
used for schema+json URI fragments, and in other JSON-based
media types such as JSON Patch.

Addresses issue json-schema-org#109 by adding "uritemplate" and "jsonpointer",
as defined by their RFCs, both of which already play roles
within JSON (Hyper-)Schema.

We use "uritemplate" in hyper-schema, but until the preprocessing
step is removed we technically can't put the format in the
meta-hyperschema.  This is being addressed elsewhere.

While we do not need "jsonpointer" for our meta-schema, it is
used for schema+json URI fragments, and in other JSON-based
media types such as JSON Patch.
</t>
<t>
A string instance is valid against this attribute if it is a valid JSON Pointer,
according to <xref target="RFC6901"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point it would be necessary to clarify if the JSON Pointer should be in its string representation or URI fragment identifier representation or is both permitted. This problem came up in #141

@handrews
Copy link
Contributor Author

No, RFC 6901 does not define a representation of a JSON Pointer as a URI fragment. It defines how to encode a JSON Pointer in a URI fragment. (specifically UTF8 + percent encoding).

That is just a URI fragment, and the interpretation of the fragment as a JSON Pointer is controlled by the media type of the document (which is always how fragments are interpreted).

If you want to use a URI with a JSON Pointer fragment, that is just a "uri" or "uriref" format. It is not, by itself, a JSON Pointer.

@epoberezkin
Copy link
Member

My suggestion is to make it json-pointer and uri-template - to be consistent with the current name (e.g. date-time) and previous proposals about this format.

Also I would add relative-json-pointer (although we had a long conversation @handrews whether relative includes absolute, which I think it does not). Although it is a separate proposal probably...

@handrews
Copy link
Contributor Author

handrews commented Dec 3, 2016

I was being consistent with "uriref"

@handrews
Copy link
Contributor Author

handrews commented Dec 3, 2016

Relative JSON Pointer does not currently actually exist anywhere in the spec, so

  1. If it ever goes in, we can define it however we want and are not limited by the previous draft proposal
  2. If it ever goes in, we can add it to format then, and it will be more clear how that should look based on how we choose to use it in the spec. If at all.

@epoberezkin
Copy link
Member

ok

@awwright awwright merged commit fac35a0 into json-schema-org:master Dec 4, 2016
@awwright
Copy link
Member

awwright commented Dec 4, 2016

While we're going to be proliferating the number of "format"s we have I suppose this is fine, between JSON Patch and JSON Schema both of these formats are used...

But I can't help but think if there's a better way to avoid defining every possible "format" we could ever need.

@handrews
Copy link
Contributor Author

handrews commented Dec 4, 2016

@awwright I agree. There are quite a few open format-related issues, and I think we should pick either draft 7 or draft 8 to take a look at the whole thing (that wouldn't be the only thing in whichever draft, I'm just saying when we tackle format we should try to do all of the format issues together as they are kinda interrelated).

@handrews handrews deleted the moreformat branch December 5, 2016 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants