Skip to content

Commit c26f382

Browse files
committed
Revert "Undo go-gen array change"
This reverts commit 5923c81.
1 parent 4dd5614 commit c26f382

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/go-gen/src/schema.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,16 @@ pub fn array_item_type(
246246
Some(SingleOrVec::Single(array_validation)) => {
247247
schema_object_type(array_validation.object()?, type_context, additional_structs)
248248
}
249+
Some(SingleOrVec::Vec(v))
250+
if v.len() == 1 || v.len() > 1 && v.windows(2).all(|w| w[0] == w[1]) =>
251+
{
252+
// all items are the same type
253+
schema_object_type(
254+
v.first().unwrap().object()?,
255+
type_context,
256+
additional_structs,
257+
)
258+
}
249259
_ => bail!("array type with non-singular item type is not supported"),
250260
}
251261
}

0 commit comments

Comments
 (0)