[Schema] SEP-2106: Support JSON Schema 2020-12 vocabulary in SchemaGenerator (oneOf/anyOf/allOf/if-then-else/$ref)

未关闭
#356 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
php

调研方向

从总 issue #337 和 SEP-2106 开始,然后检查 src/Capability/Discovery/SchemaGenerator.php 和 SchemaValidator.php,以及这里提到的 #[Schema] 属性和 reflection/DocBlock 路径。在评估应如何呈现和验证组合、条件、引用和联合类型之前,先梳理现有的简单 schema 流程。完成的标准是:列出的 JSON Schema 2020-12 词汇在这些路径中均受支持,同时不削弱 same-document $ref 的默认行为。

由索引模型根据 Issue 内容生成。

描述

2026-07-28 enhancement improves spec compliance needs design Schema

Implements the vocabulary portion of SEP-2106 for the MCP Spec 2026-07-28 release.

Tracked by umbrella #337.

Spec summary

inputSchema keeps type: "object" required but accepts any JSON Schema 2020-12 vocabulary (oneOf/anyOf/allOf/not, if/then/else, $ref/$defs/$anchor).

PHP SDK changes

  • src/Capability/Discovery/SchemaGenerator.php and SchemaValidator.php need to emit/validate full JSON Schema 2020-12 composition, conditionals, $ref (same-document only by default).
  • #[Schema] attribute should accept composition keywords.
  • Reflection/DocBlock paths today produce simple {type, properties} only — extend to surface union types as oneOf/anyOf.

Related

  • Umbrella #337
  • Companion sub-issues: non-object outputSchema, $ref hardening
主要语言
PHP
星标
1.6k
派生
173
平均合并
2 天 49 分钟
30 天内合并 PR
23

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/php-sdk 的其他 Issue

查看 modelcontextprotocol/php-sdk 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。