You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now it is currently impossible to serialize the schema object into a string. The currently used version of serde_json_wasm in CW 1.1.9 is 0.4.1 which doesn't even support maps. But even when using 0.5.0 which does we run into the dreaded floating point issue. So I can see several options:
Wait until enum support in serde_json_wasm just works™ (which might be never not very soon from the looks of it) .
Slap together some hack to serialize the schemars object into a valid JSON schema, but:
This means that we have to add code to the core crate just to support this.
The DSL macro crate becomes dependent on Fadroma.
Needs more research into how feasible this even is.
It is a hack...
Come up with our own format which also has it's problems and downsides:
Obviously needs the most thought and work put into it.
It needs to be decided whether the format would be human or machine focused. Currently, the interface of a contract can only be inferred by guessing. It would be nice to have a nice and concise human-readable representation which JSON schema is not. On the other hand we want tools to be able to validate it. We will need client-side parsers if that's the case...
This introduces our own format and we have require people to derive it for their types (even if it's automatic). We are already doing this for the binary ser/de but I'd argue that the case for that is MUCH stronger than it is for this.
Some trickery may be required to include the results of cosmwasm_schema into the contract. Might be easier to tackle this via the contract macro.
The text was updated successfully, but these errors were encountered: