feat(server): improve API specification (#1853)

This commit is contained in:
Michel Heusschen
2023-02-24 17:01:10 +01:00
committed by GitHub
parent da9b9c8c69
commit 9323cc76d9
41 changed files with 1690 additions and 396 deletions

View File

@@ -75,6 +75,10 @@ import 'package:openapi/api.dart';
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
final api_instance = AuthenticationApi();
final changePasswordDto = ChangePasswordDto(); // ChangePasswordDto |
@@ -99,7 +103,7 @@ Name | Type | Description | Notes
### Authorization
[bearer](../README.md#bearer)
[bearer](../README.md#bearer), [cookie](../README.md#cookie)
### HTTP request headers
@@ -161,6 +165,16 @@ No authorization required
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
final api_instance = AuthenticationApi();
@@ -181,7 +195,7 @@ This endpoint does not need any parameter.
### Authorization
No authorization required
[bearer](../README.md#bearer), [cookie](../README.md#cookie)
### HTTP request headers
@@ -206,6 +220,10 @@ import 'package:openapi/api.dart';
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
final api_instance = AuthenticationApi();
@@ -226,7 +244,7 @@ This endpoint does not need any parameter.
### Authorization
[bearer](../README.md#bearer)
[bearer](../README.md#bearer), [cookie](../README.md#cookie)
### HTTP request headers