-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1478 from CosmWasm/separate-schema-files
Add option to generate separate JSON schema files
- Loading branch information
Showing
73 changed files
with
9,311 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InstantiateMsg", | ||
"description": "A placeholder where we don't take any input", | ||
"type": "object", | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InstantiateMsg", | ||
"type": "object", | ||
"additionalProperties": false | ||
} |
17 changes: 17 additions & 0 deletions
17
contracts/crypto-verify/schema/raw/response_to_list_verification_schemes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ListVerificationsResponse", | ||
"type": "object", | ||
"required": [ | ||
"verification_schemes" | ||
], | ||
"properties": { | ||
"verification_schemes": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
14 changes: 14 additions & 0 deletions
14
contracts/crypto-verify/schema/raw/response_to_verify_cosmos_signature.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "VerifyResponse", | ||
"type": "object", | ||
"required": [ | ||
"verifies" | ||
], | ||
"properties": { | ||
"verifies": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
14 changes: 14 additions & 0 deletions
14
contracts/crypto-verify/schema/raw/response_to_verify_ethereum_text.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "VerifyResponse", | ||
"type": "object", | ||
"required": [ | ||
"verifies" | ||
], | ||
"properties": { | ||
"verifies": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
14 changes: 14 additions & 0 deletions
14
contracts/crypto-verify/schema/raw/response_to_verify_ethereum_transaction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "VerifyResponse", | ||
"type": "object", | ||
"required": [ | ||
"verifies" | ||
], | ||
"properties": { | ||
"verifies": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
14 changes: 14 additions & 0 deletions
14
contracts/crypto-verify/schema/raw/response_to_verify_tendermint_batch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "VerifyResponse", | ||
"type": "object", | ||
"required": [ | ||
"verifies" | ||
], | ||
"properties": { | ||
"verifies": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
14 changes: 14 additions & 0 deletions
14
contracts/crypto-verify/schema/raw/response_to_verify_tendermint_signature.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "VerifyResponse", | ||
"type": "object", | ||
"required": [ | ||
"verifies" | ||
], | ||
"properties": { | ||
"verifies": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ExecuteMsg", | ||
"oneOf": [ | ||
{ | ||
"description": "Hashes some data. Uses CPU and memory, but no external calls.", | ||
"type": "object", | ||
"required": [ | ||
"argon2" | ||
], | ||
"properties": { | ||
"argon2": { | ||
"type": "object", | ||
"required": [ | ||
"mem_cost", | ||
"time_cost" | ||
], | ||
"properties": { | ||
"mem_cost": { | ||
"description": "The amount of memory requested (KB).", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
}, | ||
"time_cost": { | ||
"description": "The number of passes.", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Returns the env for testing", | ||
"type": "object", | ||
"required": [ | ||
"mirror_env" | ||
], | ||
"properties": { | ||
"mirror_env": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InstantiateMsg", | ||
"description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", | ||
"type": "object" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ExecuteMsg", | ||
"oneOf": [ | ||
{ | ||
"description": "Hashes some data. Uses CPU and memory, but no external calls.", | ||
"type": "object", | ||
"required": [ | ||
"argon2" | ||
], | ||
"properties": { | ||
"argon2": { | ||
"type": "object", | ||
"required": [ | ||
"mem_cost", | ||
"time_cost" | ||
], | ||
"properties": { | ||
"mem_cost": { | ||
"description": "The amount of memory requested (KB).", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
}, | ||
"time_cost": { | ||
"description": "The number of passes.", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Returns the env for testing", | ||
"type": "object", | ||
"required": [ | ||
"mirror_env" | ||
], | ||
"properties": { | ||
"mirror_env": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ExecuteMsg", | ||
"oneOf": [ | ||
{ | ||
"description": "Hashes some data. Uses CPU and memory, but no external calls.", | ||
"type": "object", | ||
"required": [ | ||
"argon2" | ||
], | ||
"properties": { | ||
"argon2": { | ||
"type": "object", | ||
"required": [ | ||
"mem_cost", | ||
"time_cost" | ||
], | ||
"properties": { | ||
"mem_cost": { | ||
"description": "The amount of memory requested (KB).", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
}, | ||
"time_cost": { | ||
"description": "The number of passes.", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Returns the env for testing", | ||
"type": "object", | ||
"required": [ | ||
"mirror_env" | ||
], | ||
"properties": { | ||
"mirror_env": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
98 changes: 98 additions & 0 deletions
98
contracts/cyberpunk/schema/raw/response_to_mirror_env.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Env", | ||
"type": "object", | ||
"required": [ | ||
"block", | ||
"contract" | ||
], | ||
"properties": { | ||
"block": { | ||
"$ref": "#/definitions/BlockInfo" | ||
}, | ||
"contract": { | ||
"$ref": "#/definitions/ContractInfo" | ||
}, | ||
"transaction": { | ||
"description": "Information on the transaction this message was executed in. The field is unset when the `MsgExecuteContract`/`MsgInstantiateContract`/`MsgMigrateContract` is not executed as part of a transaction.", | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/TransactionInfo" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
} | ||
}, | ||
"definitions": { | ||
"Addr": { | ||
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", | ||
"type": "string" | ||
}, | ||
"BlockInfo": { | ||
"type": "object", | ||
"required": [ | ||
"chain_id", | ||
"height", | ||
"time" | ||
], | ||
"properties": { | ||
"chain_id": { | ||
"type": "string" | ||
}, | ||
"height": { | ||
"description": "The height of a block is the number of blocks preceding it in the blockchain.", | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"time": { | ||
"description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Timestamp" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"ContractInfo": { | ||
"type": "object", | ||
"required": [ | ||
"address" | ||
], | ||
"properties": { | ||
"address": { | ||
"$ref": "#/definitions/Addr" | ||
} | ||
} | ||
}, | ||
"Timestamp": { | ||
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Uint64" | ||
} | ||
] | ||
}, | ||
"TransactionInfo": { | ||
"type": "object", | ||
"required": [ | ||
"index" | ||
], | ||
"properties": { | ||
"index": { | ||
"description": "The position of this transaction in the block. The first transaction has index 0.\n\nThis allows you to get a unique transaction indentifier in this chain using the pair (`env.block.height`, `env.transaction.index`).", | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
} | ||
} | ||
}, | ||
"Uint64": { | ||
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", | ||
"type": "string" | ||
} | ||
} | ||
} |
Oops, something went wrong.