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
Fix ArrayDescriber splitting arrayKey() union into anyOf [array, object]
When TypeInfo resolves `array<T>` (single generic parameter, no explicit
key type), the key defaults to `arrayKey()` which is `union(int, string)`.
ArrayDescriber was splitting this into separate `array<int, T>` and
`array<string, T>` types, producing `anyOf: [{type: array}, {type: object}]`
in the OpenAPI schema. This is incorrect — `array<T>` in PHP means a
JSON array, not "either array or object".
Additionally, when a Traversable object is used as a generic parameter
(e.g. `list<MyIterableClass>`), StringTypeResolver wraps it in
CollectionType(ObjectType) with no key/value type info. ArrayDescriber
then describes this as `array<unknown>`. The fix detects when the wrapped
type is an ObjectType and delegates to the chain so ClassDescriber can
create a proper `$ref`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments