You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I tried to generate a new client using the java resttemplate library. The OpenAPI specification I am using has got a header specified which is named 'Content-Type'. The generated parameter is called contentType. This clashes with the contentType variable defined in the api.mustache. The local variable should have got the localVar prefix.
openapi-generator version
5.1.1
OpenAPI declaration file content or url
openapi: "3.0.0"info:
title: Hello Worldversion: "1.0"servers:
- url: http://localhost:9090/v1.0paths:
/greeting:
get:
summary: Generate greetingdescription: Generates a greeting message.operationId: hello.post_greetingresponses:
200:
description: greeting responsecontent:
text/plain:
schema:
type: stringexample: "hello dave!"parameters:
- name: Content-Typein: headerdescription: Name of the person to greet.required: trueschema:
type: stringexample: "dave"
Generation Details
I am generating the client using the openapi-generator-maven-plugin. The bug however is found in the template, so it should shall exists in all generators.
The bug can be reproduced by generating a client using the java generator and the resttemplate library. You could use the above configuration for the maven-plugin, and the openapi file specified above.
Bug Report Checklist
Description
I tried to generate a new client using the java resttemplate library. The OpenAPI specification I am using has got a header specified which is named 'Content-Type'. The generated parameter is called contentType. This clashes with the contentType variable defined in the api.mustache. The local variable should have got the localVar prefix.
openapi-generator version
5.1.1
OpenAPI declaration file content or url
Generation Details
I am generating the client using the openapi-generator-maven-plugin. The bug however is found in the template, so it should shall exists in all generators.
Steps to reproduce
The bug can be reproduced by generating a client using the java generator and the resttemplate library. You could use the above configuration for the maven-plugin, and the openapi file specified above.
Related issues/PRs
#9565
Suggest a fix
I created a PR which adds the localVar prefix before the local variable called contentType. I will link it to this issue.
The text was updated successfully, but these errors were encountered: