api-platform / api-platform/core
[MCP] MCP Inspector warns about incompatible JSON Schemas / Change type hinting for nullable type
- Lingua principale
- PHP
- Stelle
- 2.6k
- Fork
- 980
- Merge medio
- 2g 5h
- PR unite (30g)
- 48
Descrizione
Since recently MCP Inspector warns about the produced schema type hints:
```
`type` is an array (["string","null"]). The array form is legal JSON Schema, but several MCP clients read `type` as a single string and either reject the tool or drop the constraint.
Fix: Split it into `anyOf` branches, each with a single `type` — `{"anyOf": [{"type": "string"}, {"type": "null"}]}`. (Making the property optional instead is a different contract: absent is not the same as `null`.)
```
Like the warning message says, the behavior of the API Platform here is not necessarily wrong, but changing the way how these type hints are declared might ensure wider compatibility.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.