Skip to content

Commit

Permalink
fix(schema): make Role transparent
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Jul 24, 2024
1 parent 2dec013 commit afcc006
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
3 changes: 2 additions & 1 deletion data_model/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ mod model {
#[derive(
DebugCustom, Display, Clone, IdEqOrdHash, Decode, Encode, Serialize, Deserialize, IntoSchema,
)]
#[display(fmt = "[{id}]")]
#[debug(fmt = "[{id:?}] {{ metadata: {metadata} }}")]
#[display(fmt = "[{id}]")]
#[serde(rename = "Account")]
#[ffi_type]
pub struct NewAccount {
/// Identification
Expand Down
1 change: 1 addition & 0 deletions data_model/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ mod model {
Debug, Display, Clone, IdEqOrdHash, Decode, Encode, Deserialize, Serialize, IntoSchema,
)]
#[display(fmt = "{id} {mintable}{type_}")]
#[serde(rename = "AssetDefinition")]
#[ffi_type]
pub struct NewAssetDefinition {
/// The identification associated with the asset definition builder.
Expand Down
1 change: 1 addition & 0 deletions data_model/src/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ mod model {
#[derive(
Debug, Display, Clone, IdEqOrdHash, Decode, Encode, Deserialize, Serialize, IntoSchema,
)]
#[serde(rename = "Domain")]
#[display(fmt = "[{id}]")]
#[ffi_type]
pub struct NewDomain {
Expand Down
2 changes: 1 addition & 1 deletion data_model/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use alloc::{collections::BTreeMap, format, string::String, vec::Vec};
use core::borrow::Borrow;
#[cfg(feature = "std")]
use std::{collections::BTreeMap, vec::Vec};
use std::collections::BTreeMap;

use iroha_data_model_derive::model;
use iroha_primitives::json::JsonString;
Expand Down
5 changes: 3 additions & 2 deletions data_model/src/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ mod model {
Serialize,
IntoSchema,
)]
#[serde(transparent, rename = "Role")]
#[ffi_type(unsafe {robust})]
#[getset(get = "pub")]
#[serde(transparent)]
#[schema(transparent)]
#[repr(transparent)]
#[ffi_type(unsafe {robust})]
pub struct NewRole {
#[allow(missing_docs)]
#[id(transparent)]
Expand Down
12 changes: 2 additions & 10 deletions docs/source/references/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@
{
"tag": "NewRole",
"discriminant": 3,
"type": "NewRole"
"type": "Role"
},
{
"tag": "Peer",
Expand Down Expand Up @@ -2521,14 +2521,6 @@
}
]
},
"NewRole": {
"Struct": [
{
"name": "inner",
"type": "Role"
}
]
},
"NonTrivial<GenericPredicateBox<QueryOutputPredicate>>": "Vec<GenericPredicateBox<QueryOutputPredicate>>",
"NonZero<u32>": "u32",
"NonZero<u64>": "u64",
Expand Down Expand Up @@ -3211,7 +3203,7 @@
"Struct": [
{
"name": "object",
"type": "NewRole"
"type": "Role"
}
]
},
Expand Down

0 comments on commit afcc006

Please sign in to comment.