w3c / webauthn

Web Authentication: An API for accessing Public Key Credentials

Home Page:https://w3c.github.io/webauthn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Align the order of fields in PublicKeyCredentialDescriptorJSON with PublicKeyCredentialDescriptor

zacknewman opened this issue · comments

PublicKeyCredentialDescriptorJSON::id comes before PublicKeyCredentialDescriptorJSON::type despite PublicKeyCredentialDescriptor::id coming after PublicKeyCredentialDescriptor::type.

I realize that JSON deserialization should not assume the order of fields, but it would nonetheless be nice if the order of the fields were the same. While JSON is likely almost always used during client-server communication, it is not mandatory so it's possible other data exchange formats are used that do require the order of fields to match. When implementing multiple (de)serialization formats via the help of serialization frameworks like Serde, it's very beneficial to agree on field order. With both the JSON and "normal" types agreeing on field order, there is no "conflict" as to which to follow.

Good observation, thanks!

(I first re-tagged this as editorial but then reverted that, because WebIDL dictionaries are in fact defined to be ordered)

(As pointed out in #2083, the order of WebIDL dictionary members is lexicographical order, not source definition order, so this actually is an editorial change since the WebIDL definitions are equivalent)

From WG Meeting (7/31): I'm aiming to get a PR to address this ready for review by next week's meeting.