-
-
Notifications
You must be signed in to change notification settings - Fork 307
example in overview of hyperschema spec #473
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
Comments
I always hated that example. It's a bunch of stuff that is not explained or motivated and puts the emphasis on the wrong things. And breaks up the flow way too much. I would really rather not put it back. If we must have an example in the overview (and I'm actually pretty strongly agains that) then it needs to have a very clear, concise, and specific purpose. What is it trying to illustrate? "Just show a hyper-schema" is not sufficient. People can jump to the "Examples" section if that's how they want to start. There has to be a really compelling reason to break up the overview. Keeping the overview high-level is very important. |
@dlax I can perhaps see the need to just show what the basic structure of a hyper-schema is in the overview. I think what I really dislike about the example in draft-06 is how long it is, and how much it clutters hyper-schema with other things. However, a minimal example such as: {
"links": [
{
"rel": "self",
"href": "article/{id}"
}
]
} (or perhaps with could work fine. This would show the minimum useful hyper-schema (ignoring that I considered putting something like that in §5 Schema Keywords, but that didn't feel quite right (too much that was not a schema keyword). But the above example illustrates how to connect a minimally templated link with a standard link relation type to an unconstrained schema, using the instance's request URI as the base URI for @dlax would that work for you? |
@handrews Thank you taking time to answer here and trying to move forward. I'm not sure I get your proposal right, do you mean to include the schema above with only My point about having a simple but demonstrative example upfront is that readers should be able to infer how JSON Hyper-Schema can work by just reading the example and practically without reading the spec (which I think is possible with the previous example). Also, as far as I remember, there has been no clear motivation for removing examples during the rewrite in #427. So one objective of this issue is to make the decision clearer and hopefully reach a consensus. As mentioned elsewhere, we (@handrews and me) disagree about how examples should be used in the specification but since nobody else voiced their opinion, the discussion is somehow going circles. So, unless other people comment further, we (the project) should try and follow the editor's (@handrews) taste and move forward by releasing as is and closing this issue (and I'm fine with this). |
@dlax (some of this we've discussed elsewhere, but for anyone just joining..) I'd like to strike some level of compromise here, even if it is more in my direction because I would like to see what kind of feedback that produces (honestly, I expect questions about more examples, but the interesting thing will be to see which questions we get). That said, the spec needs to be comprehensible enough for people to find it worth reading. So I'd like to find the minimal example that achieves that goal. A lot of this comes back to how the validation spec has almost no examples and has been extremely successful. Other resources fill the example role. The only examples are for The reason that there are as many examples in Hyper-Schema as there are even now is that hardly anyone has ever really understood it, especially not from just reading through the spec. And (in my experience with collections) have found it difficult to apply to non-trivial systems. Basically, I want minimal examples, if any, interrupting the flow of the high-level description, with detailed, realistic examples down in the examples section. This is why I'm arguing for less here and more in #465. How would this work for you? {
"type": "object",
"properties": {
"id": {
"type": "number",
"readOnly": true
}
},
"links": [
{
"rel": "self",
"href": "article/{id}"
}
]
} This at least hints at where |
That'd work well :) |
Merged #494. |
Prior to the rewrite in #427, there was a simple yet illustrative example in the overview of hyperschema specification. See http://json-schema.org/latest/json-schema-hypermedia.html#rfc.section.3
Should we restore it?
I think so and can submit a PR if there's an agreement.
The text was updated successfully, but these errors were encountered: