ModelUtils.getUnusedSchemas reports simple model from array types as unused
Description
Found in #251
openapi-generator version
3.0.0
OpenAPI declaration file content or url
https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml
Command line used for generation
n/a (not a generation bug)
Steps to reproduce
Discovered while testing #251.
On that branch:
mvn clean install
cd modules/openapi-generator-gradle-plugin/
./gradlew assemble publishToMavenLocal
./gradlew --build-file=samples/local-spec/build.gradle generateGoWithInvalidSpec
Related issues/PRs
- #251
Suggest a fix/enhancement
ModelUtils.getUnusedSchemas calls into visitOpenAPI, and visitOpenAPI
needs to account for multiple levels of nested arrays, enums, map structures, and polymorphic types.