[Server] `#[Schema(exclusiveMinimum: true)]` is invalid under JSON Schema 2020-12

Aperta
#754 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
47/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

Start with SchemaGeneratorTest, which the issue says tests the boolean exclusiveMinimum, and trace how the PHP Schema attribute becomes the advertised schema. Check the JSON Schema 2020-12 requirement that exclusiveMinimum is numeric, then determine how the existing boolean behavior should be handled given the BC concern. Done means generated schemas are valid under 2020-12 and the chosen behavior is covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: v0.10.0, also main (3d2e831)

#[McpTool(name: 'positive')]
public function positive(#[Schema(minimum: 0, exclusiveMinimum: true)] int $n): int { return $n; }

Advertised schema: {"type":"integer","minimum":0,"exclusiveMinimum":true}. That's the draft-04 form. MCP 2025-11-25 (Basic › Schema Dialect) defaults to JSON Schema 2020-12, where exclusiveMinimum must be a number. Ajv in 2020 mode rejects it (exclusiveMinimum must be number).

The bool is tested (SchemaGeneratorTest), so this is a BC question. One option is to emit "exclusiveMinimum": 0 from minimum + true, or to accept int|float and deprecate the bool.

Lingua principale
PHP
Stelle
1.7k
Fork
206
Merge medio
1g 19h
PR unite (30g)
100

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/php-sdk

Tutte le issue di modelcontextprotocol/php-sdk

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.