Skip to content

JsonSchema and lifetime #206

Description

@FranklinChen
use nutype::nutype;
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;

/// A valid user name.
#[nutype(
    derive(PartialEq, Eq, Debug, Serialize, Deserialize, JsonSchema)
)]
pub struct Username<'a>(&'a str);

appears to fail with

error: Deriving of trait `SchemarsJsonSchema` is not (yet) supported for an arbitrary type

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions