[webauthn] PublicKeyCredentialJSON is an invalid WebIDL construct (#1958)

petervanderbeken has just created a new issue for https://github.com/w3c/webauthn:

== PublicKeyCredentialJSON is an invalid WebIDL construct ==
```
typedef (RegistrationResponseJSON or AuthenticationResponseJSON) PublicKeyCredentialJSON;
```
is invalid WebIDL. [`RegistrationResponseJSON`](https://w3c.github.io/webauthn/#dictdef-registrationresponsejson) and [`AuthenticationResponseJSON`](https://w3c.github.io/webauthn/#dictdef-authenticationresponsejson) are both dictionaries and thus not [distinguishable](https://webidl.spec.whatwg.org/#dfn-distinguishable), and WebIDL [unions](https://webidl.spec.whatwg.org/#dfn-union-type) require each pair of flattened members in a union to be distinguishable.

Replacing `PublicKeyCredentialJSON` with `object` would work (with prose describing it's either `RegistrationResponseJSON` and `AuthenticationResponseJSON`), or there might be a solution with merging `RegistrationResponseJSON` and `AuthenticationResponseJSON` into one dictionary type somehow (would probably require some creativity with required/optional members in various dictionaries).

Please view or discuss this issue at https://github.com/w3c/webauthn/issues/1958 using your GitHub account


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

Received on Wednesday, 6 September 2023 07:43:49 UTC