stellar_xdr/next/
jsonschema.rs1#![cfg(feature = "schemars")]
2use schemars::{gen::SchemaGenerator, schema::Schema, JsonSchema};
3
4macro_rules! impl_json_schema_string {
5 ($type:ident) => {
6 impl JsonSchema for super::$type {
7 fn schema_name() -> String {
8 stringify!($type).to_string()
9 }
10
11 fn json_schema(gen: &mut SchemaGenerator) -> Schema {
12 String::json_schema(gen)
13 }
14 }
15 };
16}
17
18impl_json_schema_string!(PublicKey);
19impl_json_schema_string!(AccountId);
20impl_json_schema_string!(ContractId);
21impl_json_schema_string!(MuxedAccount);
22impl_json_schema_string!(MuxedAccountMed25519);
23impl_json_schema_string!(MuxedEd25519Account);
24impl_json_schema_string!(SignerKey);
25impl_json_schema_string!(SignerKeyEd25519SignedPayload);
26impl_json_schema_string!(NodeId);
27impl_json_schema_string!(ScAddress);
28impl_json_schema_string!(AssetCode);
29impl_json_schema_string!(AssetCode4);
30impl_json_schema_string!(AssetCode12);
31impl_json_schema_string!(ClaimableBalanceId);
32impl_json_schema_string!(PoolId);
33impl_json_schema_string!(Int128Parts);
34impl_json_schema_string!(UInt128Parts);
35impl_json_schema_string!(Int256Parts);
36impl_json_schema_string!(UInt256Parts);