-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Remove "method", add "form" #290
Conversation
These "schema" keyword is too generic of a name given that there are now three schemas involved in an LDO. Change it to indicate that it is used for submitting data for processing, as is done with HTML form submissions. Rename "encType" to match.
jsonschema-hyperschema.xml
Outdated
<xref target="submissionEncType">"submissionEncType"</xref> keywords | ||
describe the domain of the processing function implemented by the target resource. | ||
This directly corresponds to HTML POST forms. The <xref target="form">"form"</xref> | ||
keyword can be used to enforce strict semantic compatibility with HTML POST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "HTML POST form" the right way to reference this?
The use of capital "POST" seems to refer (by convention) to the HTTP method POST. However, the functionality we are referencing is a form's method="post"
functionality which is not the same thing as HTTP POST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTML spec capitalizes it, so that's what I did. But that is why it is always "HTML POST" and never just "POST". If we talk about using HTTP POST then it will be "HTTP POST" (apparently I don't mention it in the current version).
There's not much I can do about the fact that HTML vs HTTP POST is confusing AF except for always prefixing "POST" with the correct spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've always thought it's typically lowercased in method=
, or at least in XHTML. I've never actually bothered looking it up. I do think lowercase is a good way to differentiate the usages, though. HTTP is case-sensitive, HTML isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, either way I went back to the HTML5 specification and I clearly misread it because the terms are lower-case. I will update this PR accordingly (I also agree with both of your concerns, I had just misread the other spec and thought I was following it)
jsonschema-hyperschema.xml
Outdated
Setting this keyword to true indicates that this link has | ||
semantics analogous to | ||
<xref target="W3C.REC-html5-20141028">HTML POST forms</xref>. | ||
This imposes additional constraints that are not present if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I take issue with describing this as "imposing additional constraints". A form with method="post"
is a construct specifically for sending data to an executable resource. It's not a constraint that submissionSchema
should be used in this case, it's just that doing so is the only way to accomplish the goal of sending data to an executable resource. It's the same with the choice of HTTP method. There is no explicit constraint that POST should be used, it just happens to be the only way to satisfy the goal of the construct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I just don't understand your distinction.
It is already the case that submissionSchema
is the only way to accomplish the goal of sending data to an executable resource. That is its purpose, and the presence or value of form
is completely irrelevant to the semantics of the submission keywords.
The only thing that "form": true
changes is forbidding any other operations. If that's not a constraint I don't know what is.
@jdesrosiers Can you elaborate some on how clients, as you would like to see, might act differently for different values of "method" or "form"? |
This removes the "method" keyword and reworks all references to HTML forms. The difference in approach between JSON Hyper-Schema and HTML+JavaScript is explained, and the different sorts of links (in terms of data usage) are described. The "form" keyword is being added to indicate HTML POST form semantics. GET forms can be simulated with "hrefSchema", and the guidance on that has been made more clear. We also now clearly acknowldege that you cannot directly specify HTML methods, as that was the largest source of confusion in the feedback to the previous draft.
Yeah, this would help me a lot. I'm not trying to be difficult with this, but if I knew what you want a conforming implementation to do that would help with the wording. As I understand it now, it's mostly documentation:
|
Honestly, I'm a little perplexed by this question. First of all,
It's pretty obvious how a web browser behaves differently when it encounters an |
@jdesrosiers I just don't understand why you need a special keyword for this. If there's a The other aspects of HTML's constructs have to do with human presentation, which is not a concern of JSON of JSON Hyper-Schema. There will often not be any human involved in the interactions at all. |
@jdesrosiers are you trying to distinguish between submission schemas that require actual human user input vs those that do not? |
I feel somewhat puzzled by all these new references to JavaScript. In some respect, these could be interpreted as "you need javascript to operate this sort of link" (or taking a step back, "you need a programming language") whereas it seems to me that any kind of intelligent client (including non-programmatic ones, like CLI) should be considered as first-class citizen. |
Also, I wonder if intensive references to HTML (and HTML |
@dlax good feedback, thanks. I've been struggling with the HTML analogies throughout Hyper-Schema as I feel like HTML is a totally unsuitable approach for machine-oriented hypermedia. The comparisons to HTML forms are, in my opinion, the root of most of the worst confusions around Hyper-Schema. If we must compare Hyper-Schema to the human web, it is the hypermedia functionality offered by the combination of HTML and JavaScript that is the thing to which we should compare Hyper-Schema. But if it's not helpful I will remove it. I'm honestly not sure what to do with this anymore. I'm still strongly in favor of removing |
@dlax I hadn't seen your second comment when I wrote my last response. JSON Hyper-Schema's "method", "encType", and "schema" keywords were originally explicitly intended to mimic HTML forms. And I have not been successful in convincing people that HTML is an awful reference point that does more harm than good. So... here we are. I'm trying to work with the desire that several project contributors seem to have to draw analogues to HTML, but it's hard to do well when I don't think it's useful in the first place. We'll figure something out, but I admit to being kinda stumped at the moment. I might not be the right person to write this particular PR. |
Henry Andrews a écrit :
I've been struggling with the HTML analogies throughout Hyper-Schema as
I feel like HTML is a totally unsuitable approach for machine-oriented
hypermedia. The comparisons to HTML forms are, in my opinion, the root
of most of the worst confusions around Hyper-Schema.
I totally agree with that.
If we must compare Hyper-Schema to the human web, it is the hypermedia
functionality offered by the combination of HTML and JavaScript that is
the thing to which we should compare Hyper-Schema.
But if it's not helpful I will remove it.
It's not unhelpful, but it may be misleading, in particular as it
appears in several places. I think more allusive mentions would be more
suitable.
I'm honestly not sure what to do with this anymore. I'm still strongly
in favor of removing |"method"| but I don't understand where anyone else
wants to go with it. But I don't think the Hyper-Schema draft as it
currently stands on master is worth publishing given that we can't even
figure out how to use it ourselves.
I also agree with removing "method".
My confusion comes from the fact that this PR does not just do this, but
also introduces a lot of references. Somehow it's a matter of this
project's workflow but I, for one, would be more comfortable if this
were done as distinct commits.
|
At least, I am convinced :) |
The JavaScript stuff can definitely be taken out and either re-introduced later or just dumped. But you can't remove |
Given that this doesn't even do what @jdesrosiers wanted from the proposal, it's probably better to dump this anyway. |
I'd be happy to split removing |
To be honest, I don't quite understand what "form" is for. I guess this has been discussed somewhere else, any pointer?
captures my understanding quite well. |
To my mind (not having read all of the issues and PRs in the last 3-5 days), the lack of clear use cases is causing a lot of confused discussion. Everyone seems to be making different assumptions about what they WANT JHS to do, and how. Maybe we need use cases which inform a requirements list of what should be possible (and what should not). That seems to be the cause of most confusion. I know @handrews has been writing a document on how hypermedia in general should work. |
@dlax "form" just comes from the discussion in #280. Having slept on this, I think I'm going to try to do the following:
@jdesrosiers I don't know if you want to move the |
I know this PR is closed, but I have a few cleanup remarks and questions to answer.
@handrews @dlax You're right, but that's not the point. Try to view this from a different perspective. You have an LDO with a
@handrews No, as we have discussed before, I make no distinction between different sources of input. It's all the same to hyper-schema. If I remember correctly, we agreed on that point.
@handrews @dlax I thought the discussion was clear and made sense, but I didn't think it was necessary. it seemed more appropriate in a blog post explaining your take on hyper-schema. My vote would be to leave it out, but I don't think it hurts others disagree.
Yeah, one of them is me. The web is the reference implementation for REST. I'm not saying it's perfect or that we should be trying to clone the web in JSON, but it would be silly to ignore it's lessons or assume they don't apply to our situation.
I endorse this plan. I've also decided that I won't hold up draft-06 for |
Thank you. I really do wish we could sort it out for 06 but it seems unlikely. |
NOTE: IGNORE THE FIRST COMMIT
This is the 2nd half of the proposed resolution to #280.
The first commit has been posted separately as PR #289, please review it there.
The second commit is here:
REVIEW THIS: 82e783b
Assuming #289 gets approved (it is much simpler), I will rebase this PR to only be the 2nd commit.
This removes the "method" keyword and reworks all references to
HTML forms. The difference in approach between JSON Hyper-Schema
and HTML+JavaScript is explained, and the different sorts of links
(in terms of data usage) are described.
The "form" keyword is being added to indicate HTML POST form
semantics. GET forms can be simulated with "hrefSchema", and the
guidance on that has been made more clear.
We also now clearly acknowldege that you cannot directly specify
HTML methods, as that was the largest source of confusion in the
feedback to the previous draft.