Closed aneksamun closed 3 years ago
I would like to generate a client which is required to use a basic authentication to connect to the service. Unfortunately I do get an error
value withCredentials is not a member of sttp.client.SpecifyAuthScheme[sttp.client.Identity,Either[String,String],Nothing]
Checking sttp client source code I can see that real function name should be basic. https://github.com/softwaremill/sttp/blob/61dc6aecc93c70891ba7c74bc100ed5e65a94777/core/src/main/scala/sttp/client3/RequestT.scala#L396
sttp
basic
Occurs in 5.0.0
openapi: 3.0.0 info: title: Test API version: '1.0' servers: - url: /api paths: /ping: get: description: ping operationId: ping responses: '200': description: ping pong content: application/json: schema: type: string components: securitySchemes: basicAuth: type: http scheme: basic security: - basicAuth: []
openapi-generator-cli generate \ -i openapi.yaml \ -g scala-sttp \ --additional-properties sttpClientVersion=2.2.0,mainPackage=test.api \ -o test-api
Bug is easy reproducible using basic authentication as authentication method
Use correct function name in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache#L28
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Bug Report Checklist
Description
I would like to generate a client which is required to use a basic authentication to connect to the service. Unfortunately I do get an error
Checking
sttp
client source code I can see that real function name should bebasic
. https://github.com/softwaremill/sttp/blob/61dc6aecc93c70891ba7c74bc100ed5e65a94777/core/src/main/scala/sttp/client3/RequestT.scala#L396openapi-generator version
Occurs in 5.0.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Bug is easy reproducible using basic authentication as authentication method
Suggest a fix
Use correct function name in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache#L28