If an array schema directly contains an object schema as its items, then it won't always codegen.
This doesn't work:
type: array
items:
type: object
properties:
foo:
type: integer
required: [foo]
This does work:
type: array
items:
$ref: "../theObjectSchema"