fix(server): correct openapi response type for getServerLicense() ()

* fix(server): correct openapi response type for getServerLicense()

* return 404 error when license doesn't exist

* update e2e test
This commit is contained in:
Michel Heusschen 2024-07-22 15:50:45 +02:00 committed by GitHub
commit 849bc6e3aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 36 additions and 14 deletions
mobile/openapi/lib/api

View file

@ -75,7 +75,7 @@ class ServerApi {
);
}
Future<Object?> getServerLicense() async {
Future<LicenseResponseDto?> getServerLicense() async {
final response = await getServerLicenseWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
@ -84,7 +84,7 @@ class ServerApi {
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Object',) as Object;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LicenseResponseDto',) as LicenseResponseDto;
}
return null;