Version
4.33.4
Question
#[SerializedName('is_kyc_completed')]
private bool $isKycCompleted = false;
public function isKycCompleted(): bool
{
return $this->isKycCompleted;
}
public function setIsKycCompleted(bool $isKycCompleted): void
{
$this->isKycCompleted = $isKycCompleted;
}
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
$metadataAwareNameConverter = new MetadataAwareNameConverter($classMetadataFactory);
$serializer = new Serializer(
[
new DateTimeNormalizer(),
//new SellerSalesChannelNormalizer($this->normalizer),
new ObjectNormalizer($classMetadataFactory, $metadataAwareNameConverter)],
['json' => new JsonEncoder()]
);
$serializer->serialize(
$body,
'json',
[
AbstractObjectNormalizer::SKIP_NULL_VALUES => true,
AbstractNormalizer::IGNORED_ATTRIBUTES => ['passwordHasherName'],
AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function () {
return [];
},
//SellerSalesChannelNormalizer::KYC_COMPLETED_RENAME => true,
]
)
If I do not use SellerSalesChannelNormalizer then it serializes this property name to
'kycCompleted' .
If I change getter to like getIsKycCompleted() then it serializes to is_kyc_completed - as in SerializedName attribute.
With custom normalized I fix it but that is additional code which I expect should not be needed.
Yea I see I could avoid custom normalizer by renaming getter to getIsKycCompleted, maybe I should choose this option but still even this is not expected to be needed.
Additional context
No response
Version
4.33.4
Question
If I do not use SellerSalesChannelNormalizer then it serializes this property name to
'kycCompleted' .
If I change getter to like getIsKycCompleted() then it serializes to is_kyc_completed - as in SerializedName attribute.
With custom normalized I fix it but that is additional code which I expect should not be needed.
Yea I see I could avoid custom normalizer by renaming getter to getIsKycCompleted, maybe I should choose this option but still even this is not expected to be needed.
Additional context
No response