@@ -39,6 +39,8 @@ impl Parse for Options {
39
39
pub fn cw_serde_impl ( options : Options , input : DeriveInput ) -> syn:: Result < DeriveInput > {
40
40
let crate_path = & options. crate_path ;
41
41
let crate_path_displayable = crate_path. to_token_stream ( ) ;
42
+
43
+ let cw_schema_path = format ! ( "{crate_path_displayable}::cw_schema" ) ;
42
44
let serde_path = format ! ( "{crate_path_displayable}::serde" ) ;
43
45
let schemars_path = format ! ( "{crate_path_displayable}::schemars" ) ;
44
46
@@ -49,10 +51,12 @@ pub fn cw_serde_impl(options: Options, input: DeriveInput) -> syn::Result<Derive
49
51
:: std:: clone:: Clone ,
50
52
:: std:: fmt:: Debug ,
51
53
:: std:: cmp:: PartialEq ,
52
- #crate_path:: schemars:: JsonSchema
54
+ #crate_path:: schemars:: JsonSchema ,
55
+ #crate_path:: cw_schema:: Schemaifier ,
53
56
) ]
54
57
#[ allow( clippy:: derive_partial_eq_without_eq) ] // Allow users of `#[cw_serde]` to not implement Eq without clippy complaining
55
58
#[ serde( crate = #serde_path) ]
59
+ #[ schemaifier( crate = #cw_schema_path) ]
56
60
#[ schemars( crate = #schemars_path) ]
57
61
} ;
58
62
@@ -95,10 +99,12 @@ mod tests {
95
99
:: std:: clone:: Clone ,
96
100
:: std:: fmt:: Debug ,
97
101
:: std:: cmp:: PartialEq ,
98
- :: my_crate:: cw_schema:: schemars:: JsonSchema
102
+ :: my_crate:: cw_schema:: schemars:: JsonSchema ,
103
+ :: my_crate:: cw_schema:: cw_schema:: Schemaifier ,
99
104
) ]
100
105
#[ allow( clippy:: derive_partial_eq_without_eq) ]
101
106
#[ serde( crate = ":: my_crate :: cw_schema::serde" ) ]
107
+ #[ schemaifier( crate = ":: my_crate :: cw_schema::cw_schema" ) ]
102
108
#[ schemars( crate = ":: my_crate :: cw_schema::schemars" ) ]
103
109
pub struct InstantiateMsg {
104
110
pub verifier: String ,
@@ -129,10 +135,12 @@ mod tests {
129
135
:: std:: clone:: Clone ,
130
136
:: std:: fmt:: Debug ,
131
137
:: std:: cmp:: PartialEq ,
132
- :: cosmwasm_schema:: schemars:: JsonSchema
138
+ :: cosmwasm_schema:: schemars:: JsonSchema ,
139
+ :: cosmwasm_schema:: cw_schema:: Schemaifier ,
133
140
) ]
134
141
#[ allow( clippy:: derive_partial_eq_without_eq) ]
135
142
#[ serde( crate = ":: cosmwasm_schema::serde" ) ]
143
+ #[ schemaifier( crate = ":: cosmwasm_schema::cw_schema" ) ]
136
144
#[ schemars( crate = ":: cosmwasm_schema::schemars" ) ]
137
145
pub struct InstantiateMsg {
138
146
pub verifier: String ,
@@ -160,10 +168,12 @@ mod tests {
160
168
:: std:: clone:: Clone ,
161
169
:: std:: fmt:: Debug ,
162
170
:: std:: cmp:: PartialEq ,
163
- :: cosmwasm_schema:: schemars:: JsonSchema
171
+ :: cosmwasm_schema:: schemars:: JsonSchema ,
172
+ :: cosmwasm_schema:: cw_schema:: Schemaifier ,
164
173
) ]
165
174
#[ allow( clippy:: derive_partial_eq_without_eq) ]
166
175
#[ serde( crate = ":: cosmwasm_schema::serde" ) ]
176
+ #[ schemaifier( crate = ":: cosmwasm_schema::cw_schema" ) ]
167
177
#[ schemars( crate = ":: cosmwasm_schema::schemars" ) ]
168
178
pub struct InstantiateMsg { }
169
179
} ;
@@ -193,10 +203,12 @@ mod tests {
193
203
:: std:: clone:: Clone ,
194
204
:: std:: fmt:: Debug ,
195
205
:: std:: cmp:: PartialEq ,
196
- :: cosmwasm_schema:: schemars:: JsonSchema
206
+ :: cosmwasm_schema:: schemars:: JsonSchema ,
207
+ :: cosmwasm_schema:: cw_schema:: Schemaifier ,
197
208
) ]
198
209
#[ allow( clippy:: derive_partial_eq_without_eq) ]
199
210
#[ serde( crate = ":: cosmwasm_schema::serde" ) ]
211
+ #[ schemaifier( crate = ":: cosmwasm_schema::cw_schema" ) ]
200
212
#[ schemars( crate = ":: cosmwasm_schema::schemars" ) ]
201
213
#[ serde( rename_all = "snake_case" ) ]
202
214
pub enum SudoMsg {
0 commit comments