We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example spec:
message: name: userSignedUp title: User signed up event summary: Inform about a new user registration in the system contentType: application/json payload: type: object properties: nested: type: object properties: firstName: type: number description: "foo" lastName: type: boolean description: "bar" email: type: string format: email description: "baz" createdAt: type: string format: date-time description: "foo" evenMoreNested: type: object properties: nested: type: object properties: firstName: type: number description: "foo" lastName: type: boolean description: "bar" email: type: string format: email description: "baz" createdAt: type: string format: date-time description: "foo" firstName: type: string description: "foo" lastName: type: string description: "bar" email: type: string format: email description: "baz" createdAt: type: string format: date-time description: "foo"
Generates:
#[derive(Clone, Debug, Deserialize, Serialize)] pub struct EvenMoreNested { pub nested: Nested, } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserSignedup { pub nested: Nested, pub firstName: String, pub lastName: String, pub email: String, pub createdAt: String, } #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Nested { pub firstName: f64, pub lastName: bool, pub email: String, pub createdAt: String, pub evenMoreNested: EvenMoreNested, }
Which results in:
error[E0072]: recursive types `EvenMoreNested` and `Nested` have infinite size --> src/main.rs:5:1 | 5 | pub struct EvenMoreNested { | ^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | pub nested: Nested, | ------ recursive without indirection ... 19 | pub struct Nested { | ^^^^^^^^^^^^^^^^^ ... 24 | pub evenMoreNested: EvenMoreNested, | -------------- recursive without indirection | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | 6 ~ pub nested: Box<Nested>, 7 | } ... 23 | pub createdAt: String, 24 ~ pub evenMoreNested: Box<EvenMoreNested>, | For more information about this error, try `rustc --explain E0072`. error: could not compile `email_server` due to previous error
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example spec:
Generates:
Which results in:
The text was updated successfully, but these errors were encountered: