diff --git a/schemars/tests/chrono.rs b/schemars/tests/chrono.rs index 056e6fe..7f518d7 100644 --- a/schemars/tests/chrono.rs +++ b/schemars/tests/chrono.rs @@ -3,7 +3,8 @@ use chrono::prelude::*; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct ChronoTypes { weekday: Weekday, date_time: DateTime, diff --git a/schemars/tests/crate_alias.rs b/schemars/tests/crate_alias.rs index 5f8d83c..e5d56f9 100644 --- a/schemars/tests/crate_alias.rs +++ b/schemars/tests/crate_alias.rs @@ -5,9 +5,10 @@ use util::*; #[allow(unused_imports)] use std as schemars; -#[derive(Debug, not_schemars::JsonSchema)] +#[allow(dead_code)] +#[derive(not_schemars::JsonSchema)] #[schemars(crate = "not_schemars")] -pub struct Struct { +struct Struct { /// This is a document foo: i32, bar: bool, diff --git a/schemars/tests/default.rs b/schemars/tests/default.rs index c44a3c2..e654630 100644 --- a/schemars/tests/default.rs +++ b/schemars/tests/default.rs @@ -24,41 +24,44 @@ where ser.collect_str(&format_args!("i:{} b:{}", value.my_int, value.my_bool)) } -#[derive(Default, JsonSchema, Debug)] +#[allow(dead_code)] +#[derive(Default, JsonSchema)] #[serde(default)] -pub struct MyStruct { - pub my_int: i32, - pub my_bool: bool, +struct MyStruct { + my_int: i32, + my_bool: bool, #[serde(serialize_with = "custom_serialize")] - pub my_struct2: MyStruct2, + my_struct2: MyStruct2, #[serde( serialize_with = "custom_serialize", skip_serializing_if = "is_default" )] - pub my_struct2_default_skipped: MyStruct2, - pub not_serialize: NotSerialize, + my_struct2_default_skipped: MyStruct2, + not_serialize: NotSerialize, } -#[derive(Default, JsonSchema, Debug, PartialEq)] +#[allow(dead_code)] +#[derive(Default, JsonSchema, PartialEq)] #[serde(default = "ten_and_true")] -pub struct MyStruct2 { +struct MyStruct2 { #[serde(default = "six")] - pub my_int: i32, - pub my_bool: bool, + my_int: i32, + my_bool: bool, } -#[derive(Default, JsonSchema, Debug)] -pub struct NotSerialize; +#[derive(Default, JsonSchema)] +struct NotSerialize; #[test] fn schema_default_values() -> TestResult { test_default_generated_schema::("default") } -#[derive(JsonSchema, Debug)] -pub struct StructWithGenericDefaults { +#[allow(dead_code)] +#[derive(JsonSchema)] +struct StructWithGenericDefaults { #[serde(default = "Vec::new")] - pub a_vec: Vec, + a_vec: Vec, } #[test] diff --git a/schemars/tests/deprecated.rs b/schemars/tests/deprecated.rs index 60ce0c9..1772a8f 100644 --- a/schemars/tests/deprecated.rs +++ b/schemars/tests/deprecated.rs @@ -4,9 +4,10 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[deprecated] -pub struct DeprecatedStruct { +struct DeprecatedStruct { foo: i32, #[deprecated] deprecated_field: bool, @@ -17,9 +18,10 @@ fn deprecated_struct() -> TestResult { test_default_generated_schema::("deprecated-struct") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[deprecated] -pub enum DeprecatedEnum { +enum DeprecatedEnum { Unit, #[deprecated] DeprecatedUnitVariant, diff --git a/schemars/tests/dereference.rs b/schemars/tests/dereference.rs index b4b6ca9..b1abab0 100644 --- a/schemars/tests/dereference.rs +++ b/schemars/tests/dereference.rs @@ -1,8 +1,9 @@ use schemars::{gen::SchemaGenerator, JsonSchema}; use std::ptr; -#[derive(Debug, JsonSchema)] -pub struct Struct { +#[allow(dead_code)] +#[derive(JsonSchema)] +struct Struct { foo: i32, bar: bool, } diff --git a/schemars/tests/docs.rs b/schemars/tests/docs.rs index be97e34..2f27771 100644 --- a/schemars/tests/docs.rs +++ b/schemars/tests/docs.rs @@ -2,7 +2,8 @@ mod util; use schemars::{gen::SchemaSettings, JsonSchema}; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] /** * * # This is the struct's title @@ -10,24 +11,25 @@ use util::*; * This is the struct's description. * */ -pub struct MyStruct { +struct MyStruct { /// # An integer - pub my_int: i32, - pub my_undocumented_bool: bool, + my_int: i32, + my_undocumented_bool: bool, /// A unit struct instance - pub my_unit: MyUnitStruct, + my_unit: MyUnitStruct, } /// # A Unit /// -#[derive(Debug, JsonSchema)] -pub struct MyUnitStruct; +#[derive(JsonSchema)] +struct MyUnitStruct; +#[allow(dead_code)] #[doc = " # This is the enum's title "] #[doc = " This is "] -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[doc = " the enum's description."] -pub enum MyEnum { +enum MyEnum { UndocumentedUnit, /// This comment is not included in the generated schema :( DocumentedUnit, @@ -69,16 +71,17 @@ fn doc_comments_enum() -> TestResult { /// # OverrideDocs struct /// This description should be overridden -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(description = "New description")] -pub struct OverrideDocs { +struct OverrideDocs { /// # Overridden #[schemars(title = "My integer", description = "This is an i32")] - pub my_int: i32, + my_int: i32, /// # Overridden /// Also overridden #[schemars(title = "", description = "")] - pub my_undocumented_bool: bool, + my_undocumented_bool: bool, } #[test] diff --git a/schemars/tests/enum.rs b/schemars/tests/enum.rs index 48e0d34..2bafefd 100644 --- a/schemars/tests/enum.rs +++ b/schemars/tests/enum.rs @@ -5,18 +5,20 @@ use util::*; // Ensure that schemars_derive uses the full path to std::string::String pub struct String; -#[derive(Debug, JsonSchema)] -pub struct UnitStruct; +#[derive(JsonSchema)] +struct UnitStruct; -#[derive(Debug, JsonSchema)] -pub struct Struct { +#[allow(dead_code)] +#[derive(JsonSchema)] +struct Struct { foo: i32, bar: bool, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(rename_all = "camelCase")] -pub enum External { +enum External { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -36,9 +38,10 @@ fn enum_external_tag() -> TestResult { test_default_generated_schema::("enum-external") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(tag = "typeProperty")] -pub enum Internal { +enum Internal { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -57,9 +60,10 @@ fn enum_internal_tag() -> TestResult { test_default_generated_schema::("enum-internal") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(untagged)] -pub enum Untagged { +enum Untagged { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -78,9 +82,10 @@ fn enum_untagged() -> TestResult { test_default_generated_schema::("enum-untagged") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(tag = "t", content = "c")] -pub enum Adjacent { +enum Adjacent { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -100,9 +105,10 @@ fn enum_adjacent_tagged() -> TestResult { test_default_generated_schema::("enum-adjacent-tagged") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(tag = "typeProperty")] -pub enum SimpleInternal { +enum SimpleInternal { A, B, C, diff --git a/schemars/tests/enum_deny_unknown_fields.rs b/schemars/tests/enum_deny_unknown_fields.rs index 8720b72..6201784 100644 --- a/schemars/tests/enum_deny_unknown_fields.rs +++ b/schemars/tests/enum_deny_unknown_fields.rs @@ -5,20 +5,22 @@ use util::*; // Ensure that schemars_derive uses the full path to std::string::String pub struct String; -#[derive(Debug, JsonSchema)] -pub struct UnitStruct; +#[derive(JsonSchema)] +struct UnitStruct; -#[derive(Debug, JsonSchema)] -pub struct Struct { +#[allow(dead_code)] +#[derive(JsonSchema)] +struct Struct { foo: i32, bar: bool, } // Outer container should always have additionalProperties: false // `Struct` variant should have additionalProperties: false -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(rename_all = "camelCase", deny_unknown_fields)] -pub enum External { +enum External { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -39,9 +41,10 @@ fn enum_external_tag() -> TestResult { } // Only `Struct` variant should have additionalProperties: false -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(tag = "typeProperty", deny_unknown_fields)] -pub enum Internal { +enum Internal { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -61,9 +64,10 @@ fn enum_internal_tag() -> TestResult { } // Only `Struct` variant should have additionalProperties: false -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(untagged, deny_unknown_fields)] -pub enum Untagged { +enum Untagged { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -83,9 +87,10 @@ fn enum_untagged() -> TestResult { } // Outer container and `Struct` variant should have additionalProperties: false -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(tag = "t", content = "c", deny_unknown_fields)] -pub enum Adjacent { +enum Adjacent { UnitOne, StringMap(Map<&'static str, &'static str>), UnitStructNewType(UnitStruct), @@ -105,9 +110,10 @@ fn enum_adjacent_tagged() -> TestResult { test_default_generated_schema::("enum-adjacent-tagged-duf") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(tag = "typeProperty", deny_unknown_fields)] -pub enum SimpleInternal { +enum SimpleInternal { A, B, C, diff --git a/schemars/tests/examples.rs b/schemars/tests/examples.rs index 7ebca58..2557e1c 100644 --- a/schemars/tests/examples.rs +++ b/schemars/tests/examples.rs @@ -3,9 +3,9 @@ use schemars::JsonSchema; use serde::Serialize; use util::*; -#[derive(Default, Debug, JsonSchema, Serialize)] +#[derive(Default, JsonSchema, Serialize)] #[schemars(example = "Struct::default", example = "null")] -pub struct Struct { +struct Struct { #[schemars(example = "eight", example = "null")] foo: i32, bar: bool, diff --git a/schemars/tests/ffi.rs b/schemars/tests/ffi.rs index ad1ed41..41bb8ce 100644 --- a/schemars/tests/ffi.rs +++ b/schemars/tests/ffi.rs @@ -3,7 +3,8 @@ use schemars::JsonSchema; use std::ffi::{OsStr, OsString}; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct OsStrings { owned: OsString, borrowed: &'static OsStr, diff --git a/schemars/tests/flatten.rs b/schemars/tests/flatten.rs index d193eb5..dcbf186 100644 --- a/schemars/tests/flatten.rs +++ b/schemars/tests/flatten.rs @@ -2,7 +2,8 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct Flat { f: f32, b: bool, @@ -12,7 +13,8 @@ struct Flat { v: Vec, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[schemars(rename = "Flat")] struct Deep1 { f: f32, @@ -21,8 +23,8 @@ struct Deep1 { v: Vec, } -#[allow(clippy::option_option)] -#[derive(Debug, JsonSchema)] +#[allow(clippy::option_option, dead_code)] +#[derive(JsonSchema)] struct Deep2 { b: bool, #[serde(flatten)] @@ -31,12 +33,14 @@ struct Deep2 { deep4: Box>>>, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct Deep3 { s: &'static str, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct Deep4 { #[serde(default)] os: &'static str, diff --git a/schemars/tests/indexmap.rs b/schemars/tests/indexmap.rs index ad89cc7..9501b67 100644 --- a/schemars/tests/indexmap.rs +++ b/schemars/tests/indexmap.rs @@ -3,7 +3,8 @@ use indexmap::{IndexMap, IndexSet}; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct IndexMapTypes { map: IndexMap, set: IndexSet, diff --git a/schemars/tests/inline_subschemas.rs b/schemars/tests/inline_subschemas.rs index c478c0a..40bae8f 100644 --- a/schemars/tests/inline_subschemas.rs +++ b/schemars/tests/inline_subschemas.rs @@ -3,14 +3,16 @@ use schemars::gen::SchemaSettings; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] -pub struct MyJob { - pub spec: MyJobSpec, +#[allow(dead_code)] +#[derive(JsonSchema)] +struct MyJob { + spec: MyJobSpec, } -#[derive(Debug, JsonSchema)] -pub struct MyJobSpec { - pub replicas: u32, +#[allow(dead_code)] +#[derive(JsonSchema)] +struct MyJobSpec { + replicas: u32, } #[test] @@ -20,15 +22,17 @@ fn struct_normal() -> TestResult { test_generated_schema::("inline-subschemas", settings) } -#[derive(Debug, JsonSchema)] -pub struct RecursiveOuter { - pub direct: Option>, - pub indirect: Option>, +#[allow(dead_code)] +#[derive(JsonSchema)] +struct RecursiveOuter { + direct: Option>, + indirect: Option>, } -#[derive(Debug, JsonSchema)] -pub struct RecursiveInner { - pub recursive: RecursiveOuter, +#[allow(dead_code)] +#[derive(JsonSchema)] +struct RecursiveInner { + recursive: RecursiveOuter, } #[test] diff --git a/schemars/tests/macro.rs b/schemars/tests/macro.rs index ca7dee8..25323ca 100644 --- a/schemars/tests/macro.rs +++ b/schemars/tests/macro.rs @@ -6,7 +6,8 @@ macro_rules! build_struct { ( $id:ident { $($t:tt)* } ) => { - #[derive(Debug, JsonSchema)] + #[allow(dead_code)] + #[derive(JsonSchema)] pub struct $id { x: u8, $($t)* @@ -53,9 +54,9 @@ macro_rules! build_enum { } build_enum!( - #[derive(Debug, JsonSchema)] + #[derive(JsonSchema)] OuterEnum { - #[derive(Debug, JsonSchema)] + #[derive(JsonSchema)] InnerStruct { x: i32 } diff --git a/schemars/tests/nonzero_ints.rs b/schemars/tests/nonzero_ints.rs index 99478ce..22623fa 100644 --- a/schemars/tests/nonzero_ints.rs +++ b/schemars/tests/nonzero_ints.rs @@ -2,7 +2,8 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MyStruct { unsigned: u32, nonzero_unsigned: std::num::NonZeroU32, diff --git a/schemars/tests/property_name.rs b/schemars/tests/property_name.rs index 3356146..aab52a7 100644 --- a/schemars/tests/property_name.rs +++ b/schemars/tests/property_name.rs @@ -2,7 +2,8 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[serde(rename_all = "camelCase")] struct MyStruct { camel_case: i32, diff --git a/schemars/tests/range.rs b/schemars/tests/range.rs index a8da4c9..0dad219 100644 --- a/schemars/tests/range.rs +++ b/schemars/tests/range.rs @@ -3,7 +3,8 @@ use schemars::JsonSchema; use std::ops::{Bound, Range, RangeInclusive}; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MyStruct { range: Range, inclusive: RangeInclusive, diff --git a/schemars/tests/remote_derive.rs b/schemars/tests/remote_derive.rs index c2f352e..dc349c6 100644 --- a/schemars/tests/remote_derive.rs +++ b/schemars/tests/remote_derive.rs @@ -6,14 +6,14 @@ use serde::Serialize; use util::*; mod other_crate { - #[derive(Debug, Default)] + #[derive(Default)] pub struct Duration { pub secs: i64, pub nanos: i32, } } -#[derive(Debug, JsonSchema, Serialize)] +#[derive(JsonSchema, Serialize)] #[serde(remote = "Duration")] struct DurationDef { secs: i64, @@ -27,7 +27,7 @@ where ser.collect_str(&format_args!("{}.{:09}s", value.secs, value.nanos)) } -#[derive(Debug, JsonSchema, Serialize)] +#[derive(JsonSchema, Serialize)] struct Process { command_line: String, #[serde(with = "DurationDef")] diff --git a/schemars/tests/remote_derive_generic.rs b/schemars/tests/remote_derive_generic.rs index e0164c3..2a5ac54 100644 --- a/schemars/tests/remote_derive_generic.rs +++ b/schemars/tests/remote_derive_generic.rs @@ -5,10 +5,9 @@ use serde::Serialize; use std::collections::{HashMap, HashSet}; use util::*; +#[allow(dead_code)] enum Or { - #[allow(dead_code)] A(A), - #[allow(dead_code)] B(B), } diff --git a/schemars/tests/result.rs b/schemars/tests/result.rs index 0da7e53..b0657e0 100644 --- a/schemars/tests/result.rs +++ b/schemars/tests/result.rs @@ -2,12 +2,14 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MyStruct { foo: i32, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct Container { result1: Result>, result2: Result, diff --git a/schemars/tests/schema_name.rs b/schemars/tests/schema_name.rs index bcba991..59fe0cf 100644 --- a/schemars/tests/schema_name.rs +++ b/schemars/tests/schema_name.rs @@ -2,7 +2,8 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MyStruct { t: T, u: U, @@ -11,7 +12,8 @@ struct MyStruct { inner: MySimpleStruct, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MySimpleStruct { foo: i32, } @@ -21,7 +23,8 @@ fn default_name_multiple_type_params() -> TestResult { test_default_generated_schema::>>("schema-name-default") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[serde(rename = "a-new-name-{W}-{T}-{T}")] #[schemars(rename_all = "camelCase")] struct MyRenamedStruct { @@ -32,7 +35,8 @@ struct MyRenamedStruct { inner: MySimpleRenamedStruct, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[serde(rename = "this-attribute-is-ignored")] #[schemars(rename = "another-new-name")] struct MySimpleRenamedStruct { diff --git a/schemars/tests/schema_with_enum.rs b/schemars/tests/schema_with_enum.rs index c204644..a91aa4d 100644 --- a/schemars/tests/schema_with_enum.rs +++ b/schemars/tests/schema_with_enum.rs @@ -9,7 +9,7 @@ fn schema_fn(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Sche #[derive(Debug)] pub struct DoesntImplementJsonSchema; -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[schemars(rename_all = "camelCase")] pub enum External { Struct { @@ -30,7 +30,7 @@ fn enum_external_tag() -> TestResult { test_default_generated_schema::("schema_with-enum-external") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[schemars(tag = "typeProperty")] pub enum Internal { Struct { @@ -47,7 +47,7 @@ fn enum_internal_tag() -> TestResult { test_default_generated_schema::("schema_with-enum-internal") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[schemars(untagged)] pub enum Untagged { Struct { @@ -68,7 +68,7 @@ fn enum_untagged() -> TestResult { test_default_generated_schema::("schema_with-enum-untagged") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[schemars(tag = "t", content = "c")] pub enum Adjacent { Struct { diff --git a/schemars/tests/schema_with_struct.rs b/schemars/tests/schema_with_struct.rs index db85d80..15fe5a2 100644 --- a/schemars/tests/schema_with_struct.rs +++ b/schemars/tests/schema_with_struct.rs @@ -6,11 +6,11 @@ fn schema_fn(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Sche ::json_schema(gen) } -#[derive(Debug)] struct DoesntImplementJsonSchema; -#[derive(Debug, JsonSchema)] -pub struct Struct { +#[allow(dead_code)] +#[derive(JsonSchema)] +struct Struct { #[schemars(schema_with = "schema_fn")] foo: DoesntImplementJsonSchema, bar: i32, @@ -23,7 +23,7 @@ fn struct_normal() -> TestResult { test_default_generated_schema::("schema_with-struct") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct Tuple( #[schemars(schema_with = "schema_fn")] DoesntImplementJsonSchema, i32, @@ -35,7 +35,7 @@ fn struct_tuple() -> TestResult { test_default_generated_schema::("schema_with-tuple") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct Newtype(#[schemars(schema_with = "schema_fn")] DoesntImplementJsonSchema); #[test] @@ -43,7 +43,7 @@ fn struct_newtype() -> TestResult { test_default_generated_schema::("schema_with-newtype") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[schemars(transparent)] pub struct TransparentNewtype(#[schemars(schema_with = "schema_fn")] DoesntImplementJsonSchema); diff --git a/schemars/tests/skip.rs b/schemars/tests/skip.rs index 70bddb4..8fbfa65 100644 --- a/schemars/tests/skip.rs +++ b/schemars/tests/skip.rs @@ -2,7 +2,8 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MyStruct { #[schemars(skip)] skipped1: i32, @@ -20,7 +21,7 @@ fn skip_struct_fields() -> TestResult { test_default_generated_schema::("skip_struct_fields") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] struct TupleStruct( #[schemars(skip)] i32, #[serde(skip)] bool, @@ -34,7 +35,7 @@ fn skip_tuple_fields() -> TestResult { test_default_generated_schema::("skip_tuple_fields") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub enum MyEnum { #[schemars(skip)] Skipped1(i32), diff --git a/schemars/tests/struct.rs b/schemars/tests/struct.rs index 73ce851..108a5d9 100644 --- a/schemars/tests/struct.rs +++ b/schemars/tests/struct.rs @@ -5,8 +5,9 @@ use util::*; // Ensure that schemars_derive uses the full path to std::string::String pub struct String; -#[derive(Debug, JsonSchema)] -pub struct Struct { +#[allow(dead_code)] +#[derive(JsonSchema)] +struct Struct { foo: i32, bar: bool, baz: Option<&'static str>, @@ -17,7 +18,7 @@ fn struct_normal() -> TestResult { test_default_generated_schema::("struct-normal") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct Tuple(i32, bool, Option<&'static str>); #[test] @@ -25,7 +26,7 @@ fn struct_tuple() -> TestResult { test_default_generated_schema::("struct-tuple") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct Newtype(i32); #[test] @@ -33,7 +34,7 @@ fn struct_newtype() -> TestResult { test_default_generated_schema::("struct-newtype") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct Unit; #[test] diff --git a/schemars/tests/struct_additional_properties.rs b/schemars/tests/struct_additional_properties.rs index 294e465..7fd64f3 100644 --- a/schemars/tests/struct_additional_properties.rs +++ b/schemars/tests/struct_additional_properties.rs @@ -2,7 +2,8 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[serde(deny_unknown_fields)] pub struct Struct { foo: i32, diff --git a/schemars/tests/time.rs b/schemars/tests/time.rs index e6b261a..7f70a59 100644 --- a/schemars/tests/time.rs +++ b/schemars/tests/time.rs @@ -3,7 +3,8 @@ use schemars::JsonSchema; use std::time::{Duration, SystemTime}; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct MyStruct { duration: Duration, time: SystemTime, diff --git a/schemars/tests/transparent.rs b/schemars/tests/transparent.rs index 7bbb24a..2591fb8 100644 --- a/schemars/tests/transparent.rs +++ b/schemars/tests/transparent.rs @@ -2,23 +2,25 @@ mod util; use schemars::JsonSchema; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] pub struct OuterStruct { inner: TransparentStruct, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] #[serde(transparent)] pub struct TransparentStruct { #[serde(with = "TransparentNewType")] inner: (), } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] #[schemars(transparent)] pub struct TransparentNewType(Option); -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct InnerStruct(String, i32); #[test] diff --git a/schemars/tests/url.rs b/schemars/tests/url.rs index a5b8acd..0e9499a 100644 --- a/schemars/tests/url.rs +++ b/schemars/tests/url.rs @@ -3,7 +3,8 @@ use schemars::JsonSchema; use url::Url; use util::*; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] struct UrlTypes { url: Url, } diff --git a/schemars/tests/validate.rs b/schemars/tests/validate.rs index c8b6809..58ef080 100644 --- a/schemars/tests/validate.rs +++ b/schemars/tests/validate.rs @@ -9,7 +9,8 @@ static STARTS_WITH_HELLO: &'static str = r"^[Hh]ello\b"; const MIN: u32 = 1; const MAX: u32 = 1000; -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] pub struct Struct { #[validate(range(min = 0.01, max = 100))] min_max: f32, @@ -47,7 +48,8 @@ pub struct Struct { required_flattened: Option, } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] pub struct Inner { x: i32, } @@ -57,7 +59,8 @@ fn validate() -> TestResult { test_default_generated_schema::("validate") } -#[derive(Debug, JsonSchema)] +#[allow(dead_code)] +#[derive(JsonSchema)] pub struct Struct2 { #[schemars(range(min = 0.01, max = 100))] min_max: f32, @@ -101,7 +104,7 @@ fn validate_schemars_attrs() -> TestResult { test_default_generated_schema::("validate_schemars_attrs") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct Tuple( #[validate(range(max = 10))] u8, #[validate(required)] Option, @@ -112,7 +115,7 @@ fn validate_tuple() -> TestResult { test_default_generated_schema::("validate_tuple") } -#[derive(Debug, JsonSchema)] +#[derive(JsonSchema)] pub struct NewType(#[validate(range(max = 10))] u8); #[test]