Skip to content

swagger-codegen-maven-plugin parses the yaml file twice #2958

@pablograna

Description

@pablograna
Description

CodeGenMojo calls (and does not use the local variable swagger):

    Swagger swagger = SwaggerParser().read(inputSpec);

and later in the code, CodegenConfigurator calls:

    Swagger swagger = new SwaggerParser().read(inputSpec, authorizationValues, true);

This shows any error twice in the plugin output.

Swagger-codegen version

I ran this from master, v 2.1.6, HEAD was 917192e.

Swagger declaration file content or url

Any yaml that does not parse correctly

Command line used for generation
Steps to reproduce
Related issues
Suggest a Fix

I simply removed the first call to the parser from the CodeGenMojo. I can as for a pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions