OpenAPITools / OpenAPITools/openapi-generator
[BUG] [Dart] Documentation for auth uses defaultApiClient.getAuthentication<ApiKeyAuth> but no such methods exists
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
But the ApiClient class has no such method. Here are the available methods on the object:
invokeAPI()
addDefaultHeader()
deserializeAsync()
serializeAsync()
deserialize()
serialize()
There's a .authentication object but the interface only has a single void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams); function.
Consequently, I don't know what the canonical way to do auth, and specifically Cookie Auth is.
openapi-generator version
commit 559a2618dfe62dc8b86d0eb169bb4d998774a21f, Sunday May 15 2022
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated sample file samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/UserApi.md and compare its authentication example with the Dart ApiClient methods and authentication interface described in the issue. Trace how Cookie Auth is represented in the generated client, then update the documentation so it uses available APIs and states the canonical authentication setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, openapi
- Domain
- api, authentication, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100