Open dradovic opened 11 months ago
We can't use required members yet (the net6.0 system.text.json source generator doesn't support them) -- so there's no clean way to annotate non-null members in the models library right now.
We should, however, continue to annotate nullable members inside of #nullable enable blocks. If we drop net6.0 when it goes out of support, it should be trivial to annotate the remaining members.
Yes. I guess the first step should be to have <Nullable>enable</Nullable>
in the Fido2.Models
project (just as you already have it in the Fido2
project). This issue is about that.
And then in a later step, the require
keyword can be used to make sure that props are correctly initialized.
`
@iamcarbon As November 12th is coming up, marking the end of LTS .net6 - is there anything we should do here?
I would be really helpful to annotate the nullability of the
Fido2.Models
types. In other words, to set<Nullable>enable</Nullable>
in theFido2.Models
project.This way, it would become clear for FIDO2 newbies to understand which information is optional and which one is required.
For example, in the demo, you have a line of code that stores a credential coming from
MakeNewCredentialAsync
:If both
Fido2.Models
andDemo
were NRT enabled, this would pop up as a compilation error. Righteously so, because I don't think it make sense to store a list containing anull
along the credential. So in this example, it would really help ifRegisteredPublicKeyCredential.DevicePubliKey
was declared asbyte[]?
. And I assume there's plenty more.