Closed abcang closed 4 months ago
Hi @abcang,
Indeed, I missed removing the icon
field. This will be deprecated in the next minor release.
To fix that issue without any changes in this library, I recomment the use of the skip_null_values
options:
<?php
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
$serializer->serialize(
Webauthn\PublicKeyCredentialRpEntity::create(
'rp name',
'rp.id'
),
'json',
[AbstractObjectNormalizer::SKIP_NULL_VALUES => true]
);
The output will be as expected:
{"id":"rp.id","name":"rp name"}
Thank you very much! I will tentatively use that option.
The icon
property will be marked as deprecated in 5.1.0 and removed in 6.0.0.
Thank you!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Version(s) affected
5.0.0
Description
The icon field of PublicKeyCredentialEntity has been removed from the specification (https://github.com/w3c/webauthn/pull/1337). So it can be removed from the implementation.
When using the WebauthnSerializerFactory serializer to serialize a PublicKeyCredentialRpEntity with an unspecified icon to JSON, the icon field appears as null. I am concerned that this may cause unexpected behavior.
How to reproduce
Output:
Possible Solution
A tentative fix would be to create a Denormalizer to filter out nulls, similar to the PublicKeyCredentialUserEntity. A radical fix would be to remove the icon property from PublicKeyCredentialEntity.
Additional Context
No response