-
Notifications
You must be signed in to change notification settings - Fork 35
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
Extensible and Type Discrimination #480
Comments
Isn't this a fundamental problem if you just look at the CDDL? Per the conversation about intersection types, I think something that matches On the other hand, nothing in the spec currently allows browsers to actually add any extra data to responses. The point of Extensible was "clients have to accept payloads with extra fields in these places". But if that's always true, then it isn't adding anything. I think what's actually needed is some constraints on how implementations can represent unilateral extensions of the protocol (which are hopefully rare, but for which there is precedent in e.g. capabilities). In that case we require that any extra fields have a |
For the specific case of |
Perhaps we should try this then. |
While working on Puppeteer, we've noticed it's very difficult to discriminate response types because response types have extensibility. This causes a reduction problem because, e.g., an EmptyResponse can in theory contain the keys of
ErrorResponse
, but the values are something completely different.I propose instead of spreading extensibility, we go along with one of the following standard options:
? extensions: (*text => any)
, that allows implementation-specific extensions, orCC: @jgraham @whimboo
The text was updated successfully, but these errors were encountered: