Skip to content

[BUG] [Java]Specified ContentType header values generates uncompilable code #9565

@tejasmehta269

Description

@tejasmehta269
Description

Error like below.
Error:(126,25) java: variable contentType is already defined in method

openapi-generator version
4.1.0, 4.1.3, 5.1.1

OpenAPI declaration file content or url.

  • name: Content-Type
    in: header
    description: Replace 'json' with 'xml' if preferred
    required: true
    style: simple
    schema:
    type: string
    example: application/json
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce

Used Maven plugin to re-produce issue.
org.openapitools
openapi-generator-maven-plugin
5.1.1

Related issues/PRs
Suggest a fix/enhancement

Simillar issue resovled earlier here. #7101

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions