-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make JSON encoding total & standardize it #658
Comments
In addition, if you agree to a breaking change, I think it would make sense to synchronize CSL with cardano-cli JSON format as much as possible. |
For the specific issue with |
One issue here is how it's all auto implemented using macros. If anything changes in the serde/jsonschema crates it'd change how it works. It also means a lot of the json is quite ugly. Metadata follows Cardano node for example but the rest doesn't. I think Plutus datum might or maybe it's just CML. The other 95%+ is auto generated. |
For the integers it's a restriction in the json library CSL uses. It would have to be fixed there to allow outside the i64 range. |
Yep we know how painful dealing with long integers in JSON can be. Forking any of the library tooling just for that is probably too expensive. |
Thanks @rooooooooob for your answer! @klntsky standardization is a good thing, but now CSL has autogenerated schemas and default JSON de/serializators for most of the protocol types and it requires not small amount of time to switch from default serde/jsonschema implementations for each type to self-written schemas and serialization/deserialization logic. CC @vsubhuman |
@lisicky here's a CIP draft: cardano-foundation/CIPs#766 I tried to synchronize it with CSL naming of types where possible |
The conventions for naming/encoding data there are different from those used in CSL - could someone please take a look and share an opinion on them |
@klntsky It was fast : ) I'll take a look during the next week. |
This is a compatibility table between JSON representation layouts in CSL and the cardano json-schema CIP.
|
@klntsky now it should work in the lates CSL alpha |
Currently, not every transaction can be converted to JSON. See #634 and its cause. This is not reflected in the type of
to_json
method.The context of the issue is: I am pushing forward an initiative to standardize JSON representations of Cardano domain types - see this CPS for info on motivation.
In order to build a universal schema, we need a "source of truth", and preferably we would like to use one of the existing implementations. CSL looks like the best candidate, because almost every offchain library is using it already. But a non-total
to_json
is not an option.I'm willing to contribute to this project. Here's what I can do:
After that, I would produce a schema and push it through the CIP acceptance process.
Would you agree to "freeze" the JSON encoding implementations after that and only evolve them in sync with the standard (CIP)?
The text was updated successfully, but these errors were encountered: