php-sdk/tests
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
..
Conformance [Server] Compose StreamableHttpTransport security middleware via defaultMiddleware() factory (#307) 2026-05-25 13:49:43 +02:00
Inspector [Examples][Tests] Make the MCP Apps example work over HTTP, and pin it (#439) 2026-08-18 14:51:34 +02:00
Integration [Schema][Server] Harden sampling tools against the spec (#420) 2026-08-15 04:13:53 +02:00
Unit [Capability] Stop a union type losing a branch (#434) 2026-08-18 14:54:52 +02:00