Open Ericson2314 opened 7 months ago
I don't think structured strings (oxymoron?) technically violate the JSON guidelines, but otherwise it seems that what you're proposing is an improvement.
Should the hash
be parsed into a record object, or should we use SRI hash strings, or both?
Should the hash be parsed into a record object, or should we use SRI hash strings, or both?
Good question. I am fine either way. At least the SRI string is not our own homegrown convention.
ca
fieldStrings like
fixed:r:sha256:adsfjlawefjliajsdl
need to be parsed, and that is no good. We should use an object instead, something likeThis should be implemented as a canonical nlohmann JSON "instance" for
ContentAddress
(and friends), with unit test characterization tests checking round trips. The ValidPathInfo JSON methods can then just use that nlohmann JSON instance.Noticed while working on https://github.com/NixOS/nix/pull/10310 -- comparing the
ca
field in the tests was way more hackish than it should be.signatures
fieldThe
<name>:<pub-key>
format should be replaced with a two-field JSON object.Other info
See also #9866 for something similar
CC @roberth