-
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
Add additionalResponses to Form #1042
Conversation
Yes, that's my only concern with this proposal. A naive solution would be to add a field {
// properties.someproperty
// ....
forms: [{
href: "uri/to/pro",
contentType: "application/json"
},{
href: "uri/to/pro",
contentType: "application/xml"
}
]
//
} |
From today' TDs call:
[{
{"success":{"/lights/1/state/bri":200}},
{"success":{"/lights/1/state/on":true}},
{"success":{"/lights/1/state/hue":50000}}
}] Philipps Hue provides the errors in that way: [ {
"error": {
"type": 7,
"address": "/lights/1/state/on",
"description": "invalid value, 123,, for parameter, on"
} }]
|
Added an issue about adding DataSchema to ExpectedResponse: #1053 One issue is that ExpectedResponse is also used for "response", where we probably don't want to add a data schema (it would be redundant with e.g. the output schema in actions). So I probably need to create a subclass of ExpectedResponse, etc. etc. In other words, doable, but some ontology bashing needed. |
It might worth introducing a mechanism that can state which one among the In today's call, we discussed a possible boolean property, |
Spec itself is ready to merge, but still needs an example; to discuss.
|
Small update to resolve point 2, making contentType an array, consistent with its use elsewhere. Note however, that unlike in ExpectedResponse, in AdditionalExpectedResponse it is optional. |
|
In minute from last meeting just noticed a request to add some text about when using "oneOf" is appropriate. I also don't mention "success" in the text. |
From today's TD call we will merge this PR. A editor note will be provided by @mmccool to point out that |
In order to handle error responses (and possibly other forms of "alternative" responses, for instance, using different contentTypes) add "additionalResponses" which effectively extends "response" into an array (with "response" identifying the "main", "normal" or "successful" response; having both "response" and "additionalResponses" maintains backward compatibility, as discussed).
Ontology, content, and JSON schemas all updated.
However, not quite done, since we need
At any rate, this is a starting point.
Related issues:
Preview | Diff