php-sdk/tests/Unit/Capability
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christopher Hertel ced762614b
[Capability] Stop a union type losing a branch (#434)
* [Capability] Stop a union type losing a branch

mapPhpTypeToJsonSchemaType() tested for array syntax before splitting the
union, so string[]|int mapped to array alone; applyArrayConstraints() then
overwrote the type with array whenever the union contained one, dropping the
scalar branch a second time. A tool declaring such a parameter rejected a
valid integer argument.

The split now happens first and only at the top level, so array<int|string>
and array{a: int|string} stay one type rather than two that do not exist, and
the array branch keeps its items alongside the others - which is what 2020-12
means by items: a constraint that applies only when the instance is an array.

* Apply suggestion from @chr-hertel

* Isolate the array branch before inferring its element type

* Don't apply items to arrays whose union branches disagree on element type
2026-08-18 14:54:52 +02:00
..
Attribute [Schema][Server] Add top-level title to Tool (#288) 2026-04-26 15:37:40 +02:00
Discovery [Capability] Stop a union type losing a branch (#434) 2026-08-18 14:54:52 +02:00
Formatter [Capability] Harden structuredContent extraction (#417) 2026-08-15 04:03:20 +02:00
Logger style: apply php-cs-fixer and PHPStan fixes (#289) 2026-04-20 20:49:15 +02:00
Registry [Server] Defer element loading to first registry read (#389) 2026-07-14 23:55:31 +02:00
Tool Add tool name validation for SEP-986 (#140) 2025-11-13 21:42:30 +01:00
RegistryTest.php [Schema][Server] Close the 2025-11-25 schema gaps and add the 2026-07-28 surface (#421) 2026-08-17 23:09:39 +02:00