Skip to content

Investigate how to reduce boilerplate that needs to be added almost to every struct #1142

@frol

Description

@frol

Moving the discussion from near/borsh-rs#277 since it is bigger than borsh. serde and schemars also contribute a lot to this ugly boilerplate:

use near_sdk::serde::{Deserialize, Serialize}
use near_sdk::borsh::{BorshDeserialize, BorshSerialize};
use near_sdk::schemars::JsonSchema;

#[derive(Deserialize, Serialize, JsonSchema, BorshDeserlialize, BorshSerialize)]
#[serde(crate = "near_sdk::serde")]
#[schemars(crate = "near_sdk::schemars")]
#[borsh(crate = "near_sdk::borsh")]
struct ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions