Skip to content

Fix News schema validation for searchNews - #15

Draft
zorkary wants to merge 1 commit into
xdevplatform:masterfrom
zorkary:fix/searchnews-news-schema
Draft

Fix News schema validation for searchNews#15
zorkary wants to merge 1 commit into
xdevplatform:masterfrom
zorkary:fix/searchnews-news-schema

Conversation

@zorkary

@zorkary zorkary commented May 6, 2026

Copy link
Copy Markdown

Summary

  • Normalize the live OpenAPI News schema before FastMCP tool generation.
  • Remove rest_id from the required fields for News when present.
  • Add id as an accepted News property when the schema only exposes rest_id.
  • Add a small unit test for the News schema normalization behavior.

Why

searchNews can fail output validation because the hosted OpenAPI spec declares News.required = ["rest_id"], while news.fields exposes id and live /2/news/search responses include id without rest_id.

This keeps XMCP usable while the hosted OpenAPI schema and live News response shape differ.

Validation

  • Ran git diff --check.
  • Ran python -m unittest test_server.py.
  • Parsed server.py with ast.parse.
  • Exercised normalize_known_spec_mismatches on a minimal News schema.
  • Loaded the hosted OpenAPI spec and verified the filtered News schema has no required rest_id and includes id.
@CLAassistant

CLAassistant commented May 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@zorkary

zorkary commented May 6, 2026

Copy link
Copy Markdown
Author

Opened issue #16 to describe the hosted OpenAPI/live API mismatch separately from this draft patch. I am leaving this PR as draft unless maintainers prefer the XMCP-side compatibility normalization here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants