[BUG] [Dart-dio] Basic Auth not working
Created by: laurensfischer
Description
The generated Basic Auth Interceptor does not work when defining basic auth as authentication scheme according to https://swagger.io/docs/specification/authentication/basic-authentication/
The interceptor looks for authInfo with type 'basic'
getAuthInfo(options, 'basic');
while the requests are generated like this:
'secure': <Map<String, String>>[
{
'type': 'http',
'name': 'basicAuth',
},
openapi-generator version
5.1.1
OpenAPI declaration file content or url
openapi: 3.0.3
...
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
security:
- basicAuth: []
Generation Details
Generated for dart-dio-next, should be the same for dart-dio.
openapi-generator generate -i api.json -g dart-dio-next -c config.json -o . --skip-validate-spec
Steps to reproduce
Generate Code with basic Auth, call setBasicAuth('basicAuth','username', 'password' )
, send a request.
Suggest a fix
Match type in BasicAuthInterceptor and in generated requests.