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

Offen
#754 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
47/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
php

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
PHP
Sterne
1.7k
Forks
206
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
100

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelcontextprotocol/php-sdk

Alle Issues in modelcontextprotocol/php-sdk

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.