Skip to content

Conversation

@Park-SeungWoo
Copy link

Fix: Partial Parsing of $ref Objects and Schema Examples in Request Body

Hi there 👋

I recently came across this project and gave it a try using the specs in the example/ directory. While testing, I noticed a few issues related to parsing and transformation to mcp tool spec. I've made some initial fixes, specifically targeting the request body section for now.

✅ Changes Included

  1. $ref Object Parsing

    • Implemented a function that replaces an object containing a $ref key with its corresponding target object from p.document.components.
  2. Unexpected Fields in Tool Spec Conversion

    • While converting parsed request body data into tool spec format, some unknown fields were being included.
    • I suspect this might be due to compatibility with a different spec version.
    • As a temporary fix, I commented out the part
unex_f

I only need ping.

  1. Schema example Parsing

    • Added support for parsing the example field defined under schema.
    • Introduced a new field in the Schema struct to hold this data.

    Final output looks like this:

final

Let me know if this approach works for you. I'd be happy to help extend the fix to other parts if needed!

Thanks 🙌

- add reference object parser
- fix request body parsing issue
- parse examples for properties
@AnyISalIn
Copy link
Contributor

Thank for your PR. I will check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants