Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Conversation

@wangqi
Copy link
Contributor

@wangqi wangqi commented Apr 29, 2025

Summary

Problem: MCPServer Schemable+extensions.swift failed to compile because its Input.schema.schemaValue does not have .json field. I added a SchemaValue.json extension that reuses the existing dictionary‐to‐JSON conversion logic and handles the boolean case, restoring correct schema serialization

Details

This change introduces a new json computed property on SchemaValue in Schemable+extensions.swift, enabling direct conversion of SchemaValue to the project’s JSON type. By delegating object-case conversion to the existing [KeywordIdentifier: JSONSchema_JSONValue].json extension (and ultimately to JSONSchema_JSONValue.value),

we:

  • Fix the compiler error on Input.schema.schemaValue.json
  • Reuse established conversion logic for consistency
  • Avoid duplicating recursive JSON-value mapping

With this in place, tools defined via @Schemable can correctly expose their input schema as JSON.

qiku added 3 commits April 29, 2025 11:14
…Input.schema.schemaValue returns a SchemaValue object, but there was no direct way to convert this to the custom JSON type. I added an extension for SchemaValue to append the json variable
…Input.schema.schemaValue returns a SchemaValue object, but there was no direct way to convert this to the custom JSON type. I added an extension for SchemaValue to append the json variable
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants