---
source: src/model/tests.rs
expression: config
---
Library {
    preamble: Some(
        String(
            "// my cool comment",
        ),
    ),
    classes: [
        Class {
            span: Span(
                0,
                0,
            ),
            name: SpannedScalar {
                value: "Foo",
                span: SourceSpan {
                    offset: SourceOffset(
                        37,
                    ),
                    length: 5,
                },
            },
            fields: [
                Field {
                    name: SpannedScalar {
                        value: "name",
                        span: SourceSpan {
                            offset: SourceOffset(
                                53,
                            ),
                            length: 6,
                        },
                    },
                    ty: SpannedScalar {
                        value: "String",
                        span: SourceSpan {
                            offset: SourceOffset(
                                65,
                            ),
                            length: 8,
                        },
                    },
                    defaults_to: None,
                    defaults_to_dart: None,
                    always_required: false,
                    docs: None,
                },
                Field {
                    name: SpannedScalar {
                        value: "age",
                        span: SourceSpan {
                            offset: SourceOffset(
                                83,
                            ),
                            length: 5,
                        },
                    },
                    ty: SpannedScalar {
                        value: "int",
                        span: SourceSpan {
                            offset: SourceOffset(
                                94,
                            ),
                            length: 5,
                        },
                    },
                    defaults_to: None,
                    defaults_to_dart: None,
                    always_required: false,
                    docs: None,
                },
            ],
            docs: None,
            extra_dart: [
                String(
                    "\n    void printMe() => print((name, age));\n  ",
                ),
            ],
        },
    ],
    unions: [
        Union {
            span: Span(
                0,
                0,
            ),
            name: SpannedScalar {
                value: "Animal",
                span: SourceSpan {
                    offset: SourceOffset(
                        176,
                    ),
                    length: 8,
                },
            },
            sealed: None,
            json_discrimminant: None,
            docs: None,
            classes: [
                Class {
                    span: Span(
                        0,
                        0,
                    ),
                    name: SpannedScalar {
                        value: "Dog",
                        span: SourceSpan {
                            offset: SourceOffset(
                                195,
                            ),
                            length: 5,
                        },
                    },
                    fields: [
                        Field {
                            name: SpannedScalar {
                                value: "breed",
                                span: SourceSpan {
                                    offset: SourceOffset(
                                        213,
                                    ),
                                    length: 7,
                                },
                            },
                            ty: SpannedScalar {
                                value: "String",
                                span: SourceSpan {
                                    offset: SourceOffset(
                                        226,
                                    ),
                                    length: 8,
                                },
                            },
                            defaults_to: Some(
                                Value {
                                    type_name: None,
                                    literal: Spanned {
                                        span: Span(
                                            255,
                                            262,
                                        ),
                                        value: String(
                                            "hello",
                                        ),
                                    },
                                },
                            ),
                            defaults_to_dart: None,
                            always_required: false,
                            docs: None,
                        },
                    ],
                    docs: None,
                    extra_dart: [],
                },
                Class {
                    span: Span(
                        0,
                        0,
                    ),
                    name: SpannedScalar {
                        value: "Cat",
                        span: SourceSpan {
                            offset: SourceOffset(
                                283,
                            ),
                            length: 5,
                        },
                    },
                    fields: [
                        Field {
                            name: SpannedScalar {
                                value: "color",
                                span: SourceSpan {
                                    offset: SourceOffset(
                                        301,
                                    ),
                                    length: 7,
                                },
                            },
                            ty: SpannedScalar {
                                value: "String",
                                span: SourceSpan {
                                    offset: SourceOffset(
                                        314,
                                    ),
                                    length: 8,
                                },
                            },
                            defaults_to: Some(
                                Value {
                                    type_name: None,
                                    literal: Spanned {
                                        span: Span(
                                            343,
                                            347,
                                        ),
                                        value: Null,
                                    },
                                },
                            ),
                            defaults_to_dart: None,
                            always_required: true,
                            docs: Some(
                                SpannedScalar {
                                    value: "some docs",
                                    span: SourceSpan {
                                        offset: SourceOffset(
                                            383,
                                        ),
                                        length: 11,
                                    },
                                },
                            ),
                        },
                    ],
                    docs: None,
                    extra_dart: [],
                },
            ],
        },
    ],
}
