Uh oh!
There was an error while loading. Please reload this page.
test(lotus_json): assert LotusJson<Option<T>> is nullable in schema - #7347
Conversation
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughChangesLotusJson schema nullability
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
hanabi1224
commented
Jul 15, 2026
LGTM, thanks! There is an outstanding lint issue to fix tho. |
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 66 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
sudo-shashank
left a comment
There was a problem hiding this comment.
lint:spellcheck failing
de41e74 to
375530dCompare0xDevNinja
commented
Jul 17, 2026
Good catch, thanks. Fixed the spellcheck failure by rewording the doc comment to avoid the word that tripped the dictionary. Should be green now. |
sudo-shashank
left a comment
There was a problem hiding this comment.
@0xDevNinjalint:clippy check is failing
Add a regression test verifying that the JSON/OpenRPC schema generated for LotusJson<Option<T>> permits null (is optional), while the non-optional LotusJson<T> counterpart does not. ClosesChainSafe#4331
375530d to
afd870cCompare0xDevNinja
commented
Jul 21, 2026
Thanks, fixed. The |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Closes#4331.
LotusJson<Option<T>>delegates its schema toOption<T::LotusJson>, whichschemarsalready renders as nullable ("type": [..., "null"]/ anullbranch inanyOf). This adds a small regression test locking that behaviour in, as suggested in the issue — verifying that:LotusJson<Option<T>>produces a schema that permitsnull(i.e. is optional in the OpenRPC spec), andLotusJson<T>counterpart does not permitnull.The helper
schema_allows_nullaccepts both the"type"union form (used for primitives/arrays) and theanyOf/oneOfform (used for$refobject types), so the test stays robust across inner types.No production code changes — test only.
Reference tests
cargo test -p forest-filecoin --lib lotus_json::opt::— 3 passed (existing snapshot + quickcheck, plus the newoptional_is_nullable_in_schema).Other information and links
Issue originally raised by @ruseinov in #4330 (comment).
Summary by CodeRabbit
nullin generated JSON/OpenRPC schemas.nullin the corresponding schemas.