Skip to content

Conversation

fatemehpourghaemi
Copy link

@fatemehpourghaemi fatemehpourghaemi commented Jul 30, 2025

Summary

This PR improves the get_mappings tool by adding a fallback mechanism to return raw JSON when strict deserialization of Elasticsearch index mappings fails. Some indices have complex or unexpected mapping structures that don't match the existing Rust types, causing deserialization errors.

Changes

  • Read the ES mapping response as raw JSON (serde_json::Value).
  • Attempt strict deserialization into HashMap<String, Mappings>.
  • On deserialization failure, return the raw JSON instead.
  • This prevents errors and preserves tool functionality for all index mappings.

Testing

  • Verified manually on indices with complex nested mappings.
  • Existing end-to-end tests pass without issues.

Additional Context

Addresses an open issue: #173

Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
1740d27

Please, read and sign the above mentioned agreement if you want to contribute to this project

Copy link

This pull request is stale because it has been open 60 days with no activity. Remove the stale label, or leave a comment, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Sep 29, 2025
@smalenfant
Copy link

This has to be fixed - Would make it 100% more usable for Claude to figure out the mapping

@github-actions github-actions bot removed the stale label Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants