fix(model): preserve elicitation property order - #1150
Open
nightcityblade wants to merge 2 commits into
Open
Conversation
DaleSeo
reviewed
Aug 7, 2026
| impl ElicitationSchema { | ||
| /// Create a new elicitation schema with the given properties | ||
| pub fn new(properties: BTreeMap<String, PrimitiveSchemaDefinition>) -> Self { | ||
| pub fn new(properties: IndexMap<String, PrimitiveSchemaDefinition>) -> Self { |
Member
There was a problem hiding this comment.
The no-local integration test still calls ElicitationSchema::new(BTreeMap::new()), so this parameter change prevents that target from compiling.
Author
There was a problem hiding this comment.
Thanks for catching this. I updated the no-local integration test to construct an IndexMap and ran the exact no-local CI test command; it passes locally. The current head is f85271d.
added 2 commits
August 8, 2026 11:14
BREAKING CHANGE: ElicitationSchema properties and ElicitationSchemaBuilder properties now use IndexMap instead of BTreeMap.
nightcityblade
force-pushed
the
fix/issue-1109
branch
from
August 8, 2026 03:15
bd02a04 to
f85271d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
ElicitationSchema.propertiesused aBTreeMap, so deserializing a server-declared form reordered its fields alphabetically. Clients could not recover the presentation order from the typed model.Why This Change Was Made
The schema and builder now use
IndexMap, whose Serde implementation preserves encounter and insertion order. Theschemarsdependency enables itsindexmap2integration so all-feature builds continue to derive JSON Schema successfully.User Impact
Elicitation forms can render fields in the order declared by the server, and serializing the typed schema retains that order.
Evidence
cargo test -p rmcp --all-features model::elicitation_schema::tests— 28 passedcargo clippy -p rmcp --all-targets --all-features -- -D warningscargo +nightly fmt --all -- --checkFixes #1109