webauthn
webauthn copied to clipboard
Align the order of fields in PublicKeyCredentialDescriptorJSON with PublicKeyCredentialDescriptor
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.