Open feamsr00 opened 1 year ago
I have a similar issue with the PropertyGenerator. When I define a properties type as Array in spotlight.io, the generation fails with
Fatal error: Uncaught TypeError: ApiPlatform\SchemaGenerator\OpenApi\Model\Type\PrimitiveType::__construct(): Argument #1 ($name) must be of type string, array given, called in ../vendor/api-platform/schema-generator/src/OpenApi/PropertyGenerator/PropertyGenerator.php on line 116
.
It is caused by a type definition in the schema json like:
"propertyName": {
"type": [
"boolean",
"null"
],
...
i've got same problem
Looks like the we have to fix openapi, because (in my case), i want to describe nullable field as.
"releasedAt": {
"type": [
"string",
"null"
],
"format": "date-time"
},
Openapi docs say this way is incorrect:
I generated openapi with ApiPlatform's bin/console api:openapi:export --spec-version=3
, so the root problem is in openapi generation
schema-gen version(s) affected: 5.1.1
Description
Received an exception when processing a json API schema.
How to reproduce
Config
>schema gen sgen\src schema.yml
schema file is attached swagger.zipAdditional Context