Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonSchema and lifetime #206

Open
FranklinChen opened this issue Feb 3, 2025 · 0 comments
Open

JsonSchema and lifetime #206

FranklinChen opened this issue Feb 3, 2025 · 0 comments

Comments

@FranklinChen
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant