archway-network / cli

Develop WASM smart contracts with the Archway network developer CLI
https://docs.archway.io
Apache License 2.0
44 stars 21 forks source link

fix(contracts): CosmWasm schema validation #227

Closed aelesbao closed 11 months ago

aelesbao commented 1 year ago

Description

During the deployment of a CW20 contract, the CLI failed to validate the schema of the Instantiate message because it contains an uint8 type, which is a primitive Rust numeric type and not supported by default on JSON Schema v7.

Since the JSON Schema generated by the schemars crate doesn't provide the format for those primitive types in the output file, the validation using ajv fails (as in this example).

Technical Description

The fixes for some of those primitive types were applied in #214, but we should find other types that the validation might fail and populate the custom formats in the SchemaValidator.

Tasks