-
Notifications
You must be signed in to change notification settings - Fork 63
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
Make contentType
optional in ExpectedResponse
and AdditionalExpectedResponse
classes
#2081
base: main
Are you sure you want to change the base?
Conversation
contentType
optional in ExpectedResponse
classcontentType
optional in ExpectedResponse
and AdditionalExpectedResponse
classes
I noticed in the meantime that there are also assertions related to the |
I am fine with this direction given the use case. However, we are not clear about the meaning of the lack of
|
I've now made a first attempt at adjusting the assertions for the two classes. I have the impression that this requires a bit more care than initially expected 😅 But I hope that the changes I made so far point in the right direction. One area that also needs to be revisited carefully is the table on the content type usage, which I haven't taken a closer look at so far. |
As there is no default value defined, the content type of additional | ||
responses MUST be explicitly specified. | ||
</span> | ||
That means that the lack of a content type value implies that the |
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 would be more specific/assertive here: When there is payload in the response, the contentType
field MUST be omitted from the expected response.
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.
This would allow us to test both cases easily. Having contentType
or not
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.
When there is payload in the response, the
contentType
field MUST be omitted from the expected response.
Hmm, do you mean when there is no payload, the field must be omitted? That would sound good to me :)
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.
Yes... A very well placed "typo" from my side :D
@egekorkan wrote:
That sounds like a big change. Would that mean that all forms which previously defaulted to |
Hmm, I think by default, we could stick to |
Not a big change in my opinion. We will have a container to define defaults for all forms anyways. Also see w3c/wot-binding-templates#357 (comment) and the comments below it |
TD call 20 Feb:
|
Description of Changes
This PR deals with an issue that was discovered in the context of w3c/wot-discovery#465 and #1776: At the moment, there is always a
contentType
assumed for anExpectedResponse
orAdditionalExpectedResponse
, although there are cases where a server does not return any kind of payload (e.g., in the case of an HTTPNo Content
response). This PR provides a potential fix for the issue, although there might be some more discussion needed here.Related Issue
Closes #1780
Type of Change
Check the correct box and add the corresponding label if you are an editor.
Preview | Diff