Open
Description
Bug description
The spec defines some well-known stopReason
values, but also allows arbitrary values to be passed as well (spec). When parsing these, the Java SDK throws an exception:
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `io.modelcontextprotocol.spec.McpSchema$CreateMessageResult$StopReason` from String "arbitrary value": not one of the values accepted for Enum class: [endTurn, stopSequence, maxTokens]
Environment
JDK21
Steps to reproduce
See PR #327
Expected behavior
SDK does not throw
Minimal Complete Reproducible example
See PR #327
Metadata
Metadata
Assignees
Labels
No labels