Skip to content
This repository was archived by the owner on Mar 1, 2019. It is now read-only.
This repository was archived by the owner on Mar 1, 2019. It is now read-only.

Make json file format more robust to versioning changes #130

Closed
@staktrace

Description

@staktrace

Right now I'm having a problem where trying to do a read_analysis_from_files is silently dropping data. After some debugging it looks like the JSON is failing to decode in some of the files, even though the JSON itself is valid. Considering that I generated the analysis data using a rust stable build and am trying to read it in a different environment using rust nightly with a possibly different version of rls-data it seems like that might be the problem.

As far as I can tell the json files are just the JSON representation of whatever the Analysis struct looks like in the code that generated the JSON. So it's not guaranteed to be portable at all.

I would like to make it so that at the very least the version of rls-data is baked into the JSON so that a user who is trying to read the analysis can quickly figure out which version of rls-data to use during decode. Or even better, actually make the schema well-defined and forwards-compatible so that future modifications to the Analysis struct will still generate JSON that can be (lossily, but with graceful degradation) parsed by decoders using an older Analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions