JsonSerialize

Derive Macro JsonSerialize 

Source
#[derive(JsonSerialize)]
{
    // Attributes available to this derive:
    #[key]
    #[skip]
}
Expand description

Derive an implementation of the JsonSerialize trait.

Fields may serialized with a distinct name using the key attribute, accepting a string literal for the key to serialize as (key("key")). Fields may be omitted from serialization with the skip attribute.

As a procedural macro, this will panic causing a compile-time error on any unexpected input.