Skip to content

Commit

Permalink
Switch to tuple.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed May 19, 2024
1 parent f7ad278 commit 5ec1561
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/macros/src/common/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'l> Container<'l> {
} else {
quote! {
#description
schema.array(ArrayType::new([
schema.tuple(TupleType::new([
#(#schema_types),*
]))
}
Expand Down
9 changes: 9 additions & 0 deletions crates/schematic/tests/macros_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,15 @@ enum AliasedEnum {
#[derive(Config)]
struct UnnamedSingle(#[setting(default = "abc", validate = validate_test)] String);

#[derive(Config)]
struct UnnamedMultiple(String, Option<usize>, bool);

#[derive(Config)]
struct UnnamedNested(#[setting(nested)] OptionalValues);

#[derive(Config)]
struct UnnamedCollection(#[setting(nested)] HashMap<String, Option<OptionalValues>>);

#[cfg(feature = "renderer_json_schema")]
#[test]
fn generates_json_schema() {
Expand Down

0 comments on commit 5ec1561

Please sign in to comment.