We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jane version(s) affected: 7.6.1 (probably all before also)
Description
JsonSchema DenormalizerGenerator does not unset the read key in input data when going into the else branch which handles reading of null values.
How to reproduce
Generate any object with nullable properties.
Possible Solution
I came up with the following solution:
--- src/Component/JsonSchema/Generator/Normalizer/DenormalizerGenerator.php 2024-04-12 08:25:00.617827483 +0000 +++ src/Component/JsonSchema/Generator/Normalizer/DenormalizerGenerator.php 2024-04-12 08:26:07.800853676 +0000 @@ -156,6 +156,7 @@ $statements[] = new Stmt\ElseIf_($invertCondition, [ new Stmt\Expression(new Expr\MethodCall($objectVariable, $this->getNaming()->getPrefixedMethodName('set', $property->getAccessorName()), [new Expr\ConstFetch(new Name('null'))])), + ...($unset ? [new Stmt\Unset_([$propertyVar])] : []) ]); } }
The unsetting, which is done here:
janephp/src/Component/JsonSchema/Generator/Normalizer/DenormalizerGenerator.php
Lines 130 to 132 in ee637d0
seems to have been forgotten here:
Lines 157 to 159 in ee637d0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Jane version(s) affected: 7.6.1 (probably all before also)
Description
JsonSchema DenormalizerGenerator does not unset the read key in input data when going into the else branch which handles reading of null values.
How to reproduce
Generate any object with nullable properties.
Possible Solution
I came up with the following solution:
The unsetting, which is done here:
janephp/src/Component/JsonSchema/Generator/Normalizer/DenormalizerGenerator.php
Lines 130 to 132 in ee637d0
seems to have been forgotten here:
janephp/src/Component/JsonSchema/Generator/Normalizer/DenormalizerGenerator.php
Lines 157 to 159 in ee637d0
The text was updated successfully, but these errors were encountered: