File: same_name.rs

package info (click to toggle)
rust-schemars 0.8.21-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,308 kB
  • sloc: makefile: 2
file content (35 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
mod util;
use schemars::JsonSchema;
use util::*;

mod a {
    use super::*;

    #[allow(dead_code)]
    #[derive(JsonSchema)]
    pub struct Config {
        test: String,
    }
}

mod b {
    use super::*;

    #[allow(dead_code)]
    #[derive(JsonSchema)]
    pub struct Config {
        test2: String,
    }
}

#[allow(dead_code)]
#[derive(JsonSchema)]
pub struct Config2 {
    a_cfg: a::Config,
    b_cfg: b::Config,
}

#[test]
fn same_name() -> TestResult {
    test_default_generated_schema::<Config2>("same_name")
}