-
-
Notifications
You must be signed in to change notification settings - Fork 950
Closed
Description
API Platform version(s) affected: 4.0.9
Description
How to reproduce
#[ApiResource]
class Test {
/** @var array<string, Foo> */
public array $foos;
}
class Foo {
public string $bar;
}above produces schema like so
"Test": {
"type": "object",
"description": "",
"deprecated": false,
"properties": {
"foos": {
"type": "object",
"additionalProperties": {
"type": "unknown_type"
}
}
}
},since "unknown_type" isn't actually recognized by OpenAPI, openapi schema validators will reject this kind of schema.
Instead, I would expect it generates schema like so
"Test": {
"type": "object",
"description": "",
"deprecated": false,
"properties": {
"foos": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {"bar": {"type": "string"}}
}
}
}
},Possible Solution
Additional Context
Metadata
Metadata
Assignees
Labels
No labels