openapi-generator-cli -g dart-dio. Генерируется, но коммитится: CI ловит дрейф openapi/openapi.json, а приложение собирается без запуска генератора. Пересобирается через just gen-client после любого изменения роутов.
4.1 KiB
4.1 KiB
fintracker_api.api.AuthApi
Load the API package
import 'package:fintracker_api/api.dart';
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| authLogin | POST /api/v1/auth/login | Login |
| authLogout | POST /api/v1/auth/logout | Logout |
| authMe | GET /api/v1/auth/me | Me |
| authRefresh | POST /api/v1/auth/refresh | Refresh |
authLogin
TokenPair authLogin(loginRequest)
Login
Example
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
final LoginRequest loginRequest = ; // LoginRequest |
try {
final response = api.authLogin(loginRequest);
print(response);
} on DioException catch (e) {
print('Exception when calling AuthApi->authLogin: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| loginRequest | LoginRequest |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
authLogout
authLogout(refreshRequest)
Logout
Example
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
final RefreshRequest refreshRequest = ; // RefreshRequest |
try {
api.authLogout(refreshRequest);
} on DioException catch (e) {
print('Exception when calling AuthApi->authLogout: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| refreshRequest | RefreshRequest |
Return type
void (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
authMe
UserOut authMe()
Me
Example
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
try {
final response = api.authMe();
print(response);
} on DioException catch (e) {
print('Exception when calling AuthApi->authMe: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
authRefresh
TokenPair authRefresh(refreshRequest)
Refresh
Example
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
final RefreshRequest refreshRequest = ; // RefreshRequest |
try {
final response = api.authRefresh(refreshRequest);
print(response);
} on DioException catch (e) {
print('Exception when calling AuthApi->authRefresh: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| refreshRequest | RefreshRequest |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]