Skip to content

JavaScript: Errornous generation of content type values containing "=" #2919

@arikon

Description

@arikon
Description

swagger-codegen produces such a code in API call methods:

      var contentTypes = ['application/json; charset=utf-8'];
      var accepts = ['application/json; charset=utf-8'];

The expected code is:

      var contentTypes = ['application/json; charset=utf-8'];
      var accepts = ['application/json; charset=utf-8'];

The part of spec source is:

consumes:
  - "application/json; charset=utf-8"

produces:
  - "application/json; charset=utf-8"
Swagger-codegen version

Latest master. Not sure if it is a regression.

Swagger declaration file content or url

https://gist.github.com/arikon/2f078fcf15aae07984c7e1d35def90bf

Command line used for generation
SWAGGER_JSON=swagger-new.json
SWAGGER_OUTPUT=sandbox-json-api

export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
export PATH=${JAVA_HOME}/bin:$PATH

java -jar swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
    -i ${SWAGGER_JSON} \
    -l javascript \
    -o ${SWAGGER_OUTPUT} \
    --additional-properties usePromises=true
Steps to reproduce
Related issues
Suggest a Fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions