dto
dto copied to clipboard
Why I get this message?
Hello! I have a dto class with such schema:
protected $schema = [
'type' => 'object',
'properties' => [
'place_id' => [
'type' => ['integer', 'null'],
],
],
'default' => [
'place_id' => null,
],
];
If I set place_id = 12, I get such error:
"type":"null" allows only null values. Pass a literal null or define your "type" as an array of types.
Why? I want to set this property in integer or in null, but it isn't work.If place_id in schema will be string
instead integer
(ex. - 'place_id' => [ 'type' => ['string', 'null'], ...]) - it is works.
version - 3.2.7