Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Oct 15, 2024
1 parent c2ed9ec commit fdb234a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions crates/sui-sdk-types/src/types/transaction/unresolved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,6 @@ pub struct UnresolvedInputArgument {
derive(serde_derive::Serialize, serde_derive::Deserialize),
serde(try_from = "serde_json::Value", into = "serde_json::Value")
)]
#[cfg_attr(
feature = "schemars",
derive(schemars::JsonSchema),
schemars(with = "serde_json::Value")
)]
pub enum UnresolvedValue {
Null,
Bool(bool),
Expand All @@ -150,6 +145,21 @@ pub enum UnresolvedValue {
Array(Vec<UnresolvedValue>),
}

#[cfg(feature = "schemars")]
impl schemars::JsonSchema for UnresolvedValue {
fn schema_name() -> std::string::String {
"UnresolvedValue".to_owned()
}

fn json_schema(_gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
schemars::schema::Schema::Bool(true)
}

fn is_referenceable() -> bool {
true
}
}

#[cfg(feature = "serde")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "serde")))]
impl TryFrom<serde_json::Value> for UnresolvedValue {
Expand Down

0 comments on commit fdb234a

Please sign in to comment.