Require JSON serialization checks coming in#179
Conversation
| <li>If |requests| does not contain [=JSON type=] values, | ||
| [=exception/throw=] a {{TypeError}}. | ||
| </li> |
There was a problem hiding this comment.
This is not right here... you need to:
- [=List/for each=] |request| of |requests|:
1.1. [=serialize a JavaScript value to a JSON string|Serialize=] |request| a to a JSON string. Rethrow any exceptions.
There was a problem hiding this comment.
@timcappalli, we also would need this on the way out, when readonly attribute object data; is set... though there might not be enough spec text in the current spec to add this right now. However, it would be good to add something.
There was a problem hiding this comment.
readonly attribute object data
The benefit of also doing this on the way back is that we could make this integrate well with fetch() ... arguably, we could also this in a separate PR ...
This is not right here... you need to:
Yeah, we'd still want to do this, I think.
There was a problem hiding this comment.
we also would need this on the way out, when readonly attribute object data; is set... though there might not be enough spec text in the current spec to add this right now. However, it would be good to add something.
@marcoscaceres @samuelgoto isn't this already covered by using the default toJSON() method?
There was a problem hiding this comment.
No. This is because if the wallet returns some bogus value that is not a JSON object (e.g., a string, or a number, will TypeError at this point), then that can't map to .data (because it's required to be an object). Thus you need to JSON parse the response before it is stored in .data... then the developer calling .toJSON() walks both the DigitalCredential instance and the . data. structure.
Make sense?
marcoscaceres
left a comment
There was a problem hiding this comment.
Couple of small things...
Co-authored-by: Marcos Cáceres <marcosc@apple.com>
|
@timcappalli, see also #179 (comment) |
Co-authored-by: Marcos Cáceres <marcosc@apple.com>
|
Blocked on tests and browser bugs. |
|
Blocked on tests. |
mohamedamir
left a comment
There was a problem hiding this comment.
Looks nice!
Thank you!
|
Still blocked on a test. |
86bb5cb to
3dc70ef
Compare
|
Implemented in WebKit and sent over a test. |
…terface https://bugs.webkit.org/show_bug.cgi?id=295018 rdar://problem/154733737 Reviewed by Abrar Rahman Protyasha. Spec change: w3c-fedid/digital-credentials#179 * Adds a default `toJSON()` method to the `DigitalCredential` interface. * Adds JSON strinfication check for incoming request, as required by the spec. Canonical link: https://commits.webkit.org/296963@main
Closes #125
The following tasks have been completed:
Implementation commitment:
Documentation and checks
Preview | Diff