fix(elicitation): preserve enumNames through ElicitationSchema serde round-trip (#905)
* fix(elicitation): preserve enumNames through ElicitationSchema serde round-trip UntitledSingleSelectEnumSchema lacked deny_unknown_fields, so a legacy enum payload containing enumNames was silently matched by that variant (ignoring the field) rather than falling through to LegacyEnumSchema. The enumNames array was lost on re-serialization. Add deny_unknown_fields to UntitledSingleSelectEnumSchema so that any unknown field (including enumNames) causes serde to try the next untagged variant, reaching LegacyEnumSchema correctly. Also add skip_serializing_if = "Option::is_none" to LegacyEnumSchema::enum_names so that an untitled legacy enum without enumNames does not serialize "enumNames": null. Fixes #903 * test(elicitation): regenerate server schema snapshot for deny_unknown_fields deny_unknown_fields on UntitledSingleSelectEnumSchema makes schemars emit additionalProperties: false for that definition. Regenerate the golden schema fixtures to match (UPDATE_SCHEMA=1 cargo test -p rmcp --test test_message_schema --all-features).
This commit is contained in:
parent
bf71eb8b09
commit
4fd4986b62
2 changed files with 43 additions and 1 deletions
|
|
@ -3642,6 +3642,7 @@
|
|||
"$ref": "#/definitions/StringTypeConst"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"enum"
|
||||
|
|
|
|||
|
|
@ -3642,6 +3642,7 @@
|
|||
"$ref": "#/definitions/StringTypeConst"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"type",
|
||||
"enum"
|
||||
|
|
|
|||
Loading…
Reference in a new issue