From cf82004b6711119b95acdf4950e005316a4c0073 Mon Sep 17 00:00:00 2001 From: ekez Date: Thu, 6 Oct 2022 12:59:27 -0700 Subject: [PATCH] Add script to autogen schema. --- .../cw2981-royalties/schema/all_nft_info_response.json | 3 ++- contracts/cw2981-royalties/schema/execute_msg.json | 5 +++-- contracts/cw2981-royalties/schema/operators_response.json | 3 ++- contracts/cw2981-royalties/schema/owner_of_response.json | 3 ++- contracts/cw721-fixed-price/schema/execute_msg.json | 2 +- contracts/cw721-metadata-onchain/schema/execute_msg.json | 2 +- scripts/schema.sh | 8 ++++++++ 7 files changed, 19 insertions(+), 7 deletions(-) create mode 100755 scripts/schema.sh diff --git a/contracts/cw2981-royalties/schema/all_nft_info_response.json b/contracts/cw2981-royalties/schema/all_nft_info_response.json index eb23abb52..d263321e2 100644 --- a/contracts/cw2981-royalties/schema/all_nft_info_response.json +++ b/contracts/cw2981-royalties/schema/all_nft_info_response.json @@ -91,7 +91,8 @@ ], "properties": { "never": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/cw2981-royalties/schema/execute_msg.json b/contracts/cw2981-royalties/schema/execute_msg.json index ca78751b5..c79dc5e98 100644 --- a/contracts/cw2981-royalties/schema/execute_msg.json +++ b/contracts/cw2981-royalties/schema/execute_msg.json @@ -235,7 +235,7 @@ ], "definitions": { "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, "Empty": { @@ -281,7 +281,8 @@ ], "properties": { "never": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/cw2981-royalties/schema/operators_response.json b/contracts/cw2981-royalties/schema/operators_response.json index 14c0e2265..533a096dd 100644 --- a/contracts/cw2981-royalties/schema/operators_response.json +++ b/contracts/cw2981-royalties/schema/operators_response.json @@ -76,7 +76,8 @@ ], "properties": { "never": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/cw2981-royalties/schema/owner_of_response.json b/contracts/cw2981-royalties/schema/owner_of_response.json index 5c82729d5..abb9006d8 100644 --- a/contracts/cw2981-royalties/schema/owner_of_response.json +++ b/contracts/cw2981-royalties/schema/owner_of_response.json @@ -82,7 +82,8 @@ ], "properties": { "never": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/cw721-fixed-price/schema/execute_msg.json b/contracts/cw721-fixed-price/schema/execute_msg.json index 08d874b4e..b9a6acead 100644 --- a/contracts/cw721-fixed-price/schema/execute_msg.json +++ b/contracts/cw721-fixed-price/schema/execute_msg.json @@ -17,7 +17,7 @@ ], "definitions": { "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, "Cw20ReceiveMsg": { diff --git a/contracts/cw721-metadata-onchain/schema/execute_msg.json b/contracts/cw721-metadata-onchain/schema/execute_msg.json index 30b2da5f6..1755aba18 100644 --- a/contracts/cw721-metadata-onchain/schema/execute_msg.json +++ b/contracts/cw721-metadata-onchain/schema/execute_msg.json @@ -235,7 +235,7 @@ ], "definitions": { "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, "Empty": { diff --git a/scripts/schema.sh b/scripts/schema.sh new file mode 100755 index 000000000..269381c61 --- /dev/null +++ b/scripts/schema.sh @@ -0,0 +1,8 @@ +START_DIR=$(pwd) +for f in ./contracts/* +do + cd "$f" + CMD="cargo run --example schema" + eval $CMD + cd "$START_DIR" +done \ No newline at end of file