Ignore unexpected properties when deserializing a ContentBlock (#956)
* Ignore unexpected properties when deserializing a ContentBlock * Fix deserialization of Reference.Title and more bugs for unknown props * Remove comments about skipping additional properties
This commit is contained in:
parent
98a0261585
commit
d4ee78797b
5 changed files with 1762 additions and 1 deletions
|
|
@ -141,6 +141,7 @@ public abstract class ContentBlock
|
|||
break;
|
||||
|
||||
default:
|
||||
reader.Skip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ public sealed class ElicitRequestParams
|
|||
break;
|
||||
|
||||
default:
|
||||
reader.Skip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@ public sealed class ProgressNotificationParams : NotificationParams
|
|||
case "_meta":
|
||||
meta = JsonSerializer.Deserialize(ref reader, McpJsonUtilities.JsonContext.Default.JsonObject);
|
||||
break;
|
||||
|
||||
default:
|
||||
reader.Skip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,11 +81,16 @@ public abstract class Reference
|
|||
name = reader.GetString();
|
||||
break;
|
||||
|
||||
case "title":
|
||||
title = reader.GetString();
|
||||
break;
|
||||
|
||||
case "uri":
|
||||
uri = reader.GetString();
|
||||
break;
|
||||
|
||||
default:
|
||||
reader.Skip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ public abstract class ResourceContents
|
|||
break;
|
||||
|
||||
default:
|
||||
reader.Skip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue