Fix Jackson serialization of granular filterable attributes - #985
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesGranular filterable attributes
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 14 UNAVAILABLE: read ECONNRESET Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/com/meilisearch/sdk/model/Settings.java`:
- Around line 64-65: Remove the `@JsonIgnore` from the String[] overload
`Settings.setFilterableAttributes(String[])` so Jackson can deserialize legacy
`filterableAttributes` arrays while retaining granular-object configuration
handling. Add a regression test covering a payload such as
`{"filterableAttributes":["title"]}` and verify the resulting settings preserve
the decoded legacy values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8f2250d6-3821-4d59-9241-6ed566bd3416
📒 Files selected for processing (2)
src/main/java/com/meilisearch/sdk/model/Settings.javasrc/test/java/com/meilisearch/sdk/json/JacksonJsonHandlerTest.java
Co-authored-by: Cursor <cursoragent@cursor.com>
Strift
left a comment
There was a problem hiding this comment.
Hello @Moustafa-Ameen and thanks for your contribution 🙌 LGTM!
Related issue
Fixes #973
What does this PR do?
Fixes Jackson serialization when callers use granular
filterableAttributesConfigvalues. Jackson previously invoked the legacygetFilterableAttributes()accessor, which throws when a configuration contains granular feature settings.filterableAttributesJSON property.String[]getter and setter from Jackson serialization while retaining them as public SDK methods.features.filterandfacetSearchsettings.Validation
./gradlew.bat compileTestJava --no-daemongit diff --checkThe full test task is blocked locally because the repository's Mockito 4 / JaCoCo 0.8.8 test setup is incompatible with the installed Java 24 runtime; the failure occurs during test initialization before assertions run.
AI usage
I used Codex to help inspect the affected serialization path and draft the implementation and regression test. I reviewed the code and validated the behavior locally.
PR checklist
Summary by CodeRabbit