Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Write tests to validate that all of vimwiki elements can be converted to json #123

Open
chipsenkbeil opened this issue May 31, 2021 · 0 comments
Labels
tests Improvements or additions to tests
Milestone

Comments

@chipsenkbeil
Copy link
Owner

We want to make sure that json conversions work. While this could be worked around by using another format, it would be good to support this and it's really easy.

The issue was that I had HashMap<SomeStruct, ...> where SomeStruct was hashable, but that can't be used by serde_json. There was supposedly support for using Display and FromStr, but the FromStr doesn't appear to get used by serde. Maybe there is a way to use it in that way, but the better approach is to use

struct BiggerStruct {
    #[serde(with = "serde_with::rust::map_as_tuple_list")]
    map: HashMap<SomeStruct, OtherData>,
}
@chipsenkbeil chipsenkbeil added the tests Improvements or additions to tests label May 31, 2021
@chipsenkbeil chipsenkbeil added this to the 0.1.0 milestone May 31, 2021
@chipsenkbeil chipsenkbeil modified the milestones: 0.1, 0.2 Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tests Improvements or additions to tests
Projects
None yet
Development

No branches or pull requests

1 participant