Skip to content

ModelUtils.getUnusedSchemas reports simple model from array types as unused #252

@jimschubert

Description

@jimschubert
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
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions