cargo-public-api
cargo-public-api copied to clipboard
Output JSON?
I would like to be able to postprocess my API diffs I generate with cargo-public-api. Would it be possible to add a feature so that cargo-public-api can output JSON?
I'd recommend you to use https://docs.rs/public-api/0.33.1/public_api/#diff-two-versions-of-a-public-api I don't see any problems with the binary providing a json output, a bit unsure what the format should be however
TIL there is a crate for that! Awesome! I'll investigate and check whether that solves my issue! <3
a bit unsure what the format should be however
For me, something as simple as this would suffice:
{
"added": ["..."],
"removed": ["..."],
"changed": [
{ "from": "...", "to": "..." }
]
}
My issue is mainly that I want to format the cargo-public-api output.
Could you explain in more detail what your use case is? I don't have strong objections to a JSON output format either, but I don't want to do it if there are better solutions to your use case/workflow. :)
I want to fill a customizable template with that data, and getting the data as json is the least complicated way.
Well, I'm open to experimentation.
Not sure we need to keep this issue open? Feel free to open a PR with a prototype once you have one.
Let's close this issue to keep the issue inbox clean. But we can of course continue discussing (preferably in the PR).