fix: use mimeType instead of mime_type for MCP specification compliance (#339)

- Fix ResourceContents enum to properly serialize with camelCase field names
- Add comprehensive tests to verify JSON serialization compliance
- Ensure all resource-related structs use mimeType as per MCP spec
- Add tests for RawResource, ResourceContents, RawImageContent, RawAudioContent
- Add test for prompt message image content serialization
- Update message schema files to reflect mimeType changes
- Fix import ordering to match project formatting standards

This change ensures the Rust SDK is fully compliant with the MCP specification
which requires mimeType (camelCase) for all resource content types.
This commit is contained in:
Andrew Harvard 2025-07-29 12:42:56 -04:00 • committed by GitHub
commit 7ba1ac4959
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 107 additions and 5 deletions

View file

@ -1129,7 +1129,7 @@
{
"type": "object",
"properties": {
"mime_type": {
"mimeType": {
"type": [
"string",
"null"
@ -1153,7 +1153,7 @@
"blob": {
"type": "string"
},
"mime_type": {
"mimeType": {
"type": [
"string",
"null"

View file

@ -1333,7 +1333,7 @@
{
"type": "object",
"properties": {
"mime_type": {
"mimeType": {
"type": [
"string",
"null"
@ -1357,7 +1357,7 @@
"blob": {
"type": "string"
},
"mime_type": {
"mimeType": {
"type": [
"string",
"null"