Re: [webauthn] New PublicKeyCredential methods for JSON (de)serialization (#1703)

> Right now the method descriptions don't quite agree with the WebIDL definitions - the descriptions say that they take in and put out JSON, which would be DOMString values, but the definitions work with JavaScript objects. We need to clarify which of the two it is - probably the latter, since there's already the `JSON.parse()` and `.stringify()` methods to transform to/from JSON?

The idea is that the "JSON" inputs are `application/json` string payloads from the server, however the RP front end and back end wish to orchestrate that parsed into complex JavaScript `Object`'s. It's the objects that are being passed into `.optionsFromJSON()` to get back out an Object with everything formatted to be immediately passed into `.create()` or `.get()`.

> I'd lean toward having the method take JSON text - this would both increase symmetry with the toJSON()method, and allow us to declare the operation of the method in terms of prose rather than IDL.

Huh, so if the input is JSON then you don't need WebIDL definitions for it? I approached it as though I was writing something akin to TypeScript definitions for these methods.

-- 
GitHub Notification of comment by MasterKale
Please view or discuss this issue at https://github.com/w3c/webauthn/pull/1703#issuecomment-1060908497 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 7 March 2022 16:58:09 UTC