Bug Report Checklist
Description
scala-sttp client generator doesn't generate doesn't generate Api properly when the request header is not a string.
openapi-generator version
The both version 6.0.0 and the latest master branch (6.0.x)
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: Request Header
version: "1.0.0"
paths:
/test:
get:
summary: Empty Route
parameters:
- description: Gets user uuid.
explode: false
in: header
name: user_uuid
required: true
schema:
format: uuid
type: string
style: simple
responses:
"200":
description: Good Request.
content:
application/json:
schema:
$ref: '#/components/schemas/ReturnValue'
"400":
description: Bad Request.
components:
schemas:
ReturnValue:
properties:
name:
type: string
Generation Details
Command line used for generation
openapi-generator-cli generate \
-g scala-sttp \
-i name_of_file.yaml \
-p mainPackage=myPackage \
-o myApi
Steps to reproduce
Generated class DefaultApi
def rootGet(userUuid: UUID): Request[Either[ResponseException[String, Exception], ReturnValue], Nothing] =
basicRequest
.method(Method.GET, uri"$baseUrl/test")
.contentType("application/json")
.header("user_uuid", userUuid)
.response(asJson[ReturnValue])
Compile Error:
DefaultApi.scala:39:8: overloaded method header with alternatives:
[error] (k: String,ov: Option[String])sttp.client3.RequestT[sttp.client3.Identity,Either[String,String],Any] <and>
[error] (k: String,v: String)sttp.client3.RequestT[sttp.client3.Identity,Either[String,String],Any] <and>
[error] (h: sttp.model.Header,replaceExisting: Boolean)sttp.client3.RequestT[sttp.client3.Identity,Either[String,String],Any]
[error] cannot be applied to (String, java.util.UUID)
[error] .header("user_uuid", userUuid)
[error] ^
Related issues/PRs
Suggest a fix
The generator should convert the value of header parameter to string.
Bug Report Checklist
Description
scala-sttp client generator doesn't generate doesn't generate Api properly when the request header is not a string.
openapi-generator version
The both version 6.0.0 and the latest master branch (6.0.x)
OpenAPI declaration file content or url
Generation Details
Command line used for generation
Steps to reproduce
Generated class DefaultApi
Compile Error:
Related issues/PRs
Suggest a fix
The generator should convert the value of header parameter to string.