Do not ignore all serde attributes if there are also schemars attributes
This commit is contained in:
parent
0304fefb61
commit
af1fa5fe9e
4 changed files with 105 additions and 37 deletions
|
@ -16,4 +16,4 @@ struct MyStruct {
|
|||
#[test]
|
||||
fn set_struct_property_names() -> TestResult {
|
||||
test_default_generated_schema::<MyStruct>("property-name-struct")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ fn default_name_multiple_type_params() -> TestResult {
|
|||
|
||||
#[derive(Debug, JsonSchema)]
|
||||
#[serde(rename = "a-new-name-{W}-{T}-{T}")]
|
||||
#[schemars(rename_all = "camelCase")]
|
||||
struct MyRenamedStruct<T, U, V, W> {
|
||||
t: T,
|
||||
u: U,
|
||||
|
@ -36,5 +37,7 @@ struct MySimpleRenamedStruct {}
|
|||
|
||||
#[test]
|
||||
fn overriden_with_rename_multiple_type_params() -> TestResult {
|
||||
test_default_generated_schema::<MyRenamedStruct<i32, (), bool, Vec<String>>>("schema-name-custom")
|
||||
test_default_generated_schema::<MyRenamedStruct<i32, (), bool, Vec<String>>>(
|
||||
"schema-name-custom",
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue