Add implementation of CandidType for serde_json::Value
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 301
- Forks
- 85
- Avg merge
- 1h 4m
- Merged PRs (30d)
- 4
Description
See this forum post for more information: https://forum.dfinity.org/t/derive-candidtype-with-serde-json/5800
Seems it would be nice for candid to implement CandidType on serde_json::Value. This would allow for candid serialization of arbitrary JSON values. I would implement CandidType myself, but in my crates I am depending on serde_json::Value and candid directly, thus I can't implement CandidType without relying on some kind of wrapper around serde_json::Value. Seems serde_json::Value is the canonical way to serialize and deserialize arbitrary JSON in Rust, so could it be added to the library here? https://github.com/dfinity/candid/blob/master/rust/candid/src/types/impls.rs
I am happy to do the work if it would be accepted.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rust/candid/src/types/impls.rs and read the linked forum discussion to understand the intended mapping for serde_json::Value. Compare nearby CandidType implementations and identify the relevant test location. Done means arbitrary JSON values can be serialized through candid without requiring a wrapper type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100