You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Corrected schema generation for array<string, T>, object, ?array, ?object and ?type
The previous version of the `TypeFactory` generated following **WRONG** definitions:
* `null|T[]` as `{"type": array, "items": {"type": "T"}}`
* `?T[]` as `{"type": array, "items": {"type": "T"}}`
* `array<string, T> as `{"type": array, "items": {"type": "T"}}`
* `object` without explicit schema definition as `{"type": "string"}`
* `?T` as `{"type": T}`
The new definitions instead do fix this by mapping:
* `array<string, T>` as `{"type": "object", "additionalProperties": {"type": "T"}}`
* `array<string, ?T> as `{"type": object, "additionalProperties": {"type": ["T", "null"]}}`
* `null|array<string, T>` as `{"type": ["object", "null"], "additionalProperties": {"type": "T"}}`
* `array<int, T>` as `{"type": "array", "items": {"type": "T"}}` (not very precise, but list support is not yet in symfony)
* `object` without explicit schema definition as `{"type": "object"}`
* `?T[]` as `{"type": "array", "items": {"type": ["T", "null"]}}`
* `null|T[]` as `{"type": ["array", "null"], "items": {"type": "T"}}`
0 commit comments