As is, using openapi-generator after bin/console api:swagger:export -y -o swagger.yaml result in a failure because the empty arrays are converted as empty objects (and openapi-generator does not like that).
Adding the Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE mask to Yaml::dump fixes the problem :
Yaml::dump($data, 6, 4, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE);