Description
Given a nullable field in OpenAPI object
SomeObject:
type: object
properties:
someProperty:
type: string
nullable: true
When HTTP Request has the object and it includes someProperty=null.
Then the generated php client code does not include someProperty in the response.
openapi-generator version
master branch (version 3.3.4)
EDIT: also version 4.0.3
OpenAPI declaration file content or url
See the description
Command line used for generation
openapi-generator generate -g php
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Remove null-check if-block if ($value !== null) from https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache#L68
by changing this
if ($value !== null) {
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
}
to this
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
Description
Given a nullable field in OpenAPI object
When HTTP Request has the object and it includes
someProperty=null.Then the generated php client code does not include
somePropertyin the response.openapi-generator version
master branch (version 3.3.4)
EDIT: also version 4.0.3
OpenAPI declaration file content or url
See the description
Command line used for generation
openapi-generator generate -g phpSteps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Remove null-check if-block
if ($value !== null)from https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache#L68by changing this
to this