From 2821ace01f291fa05aa45eff87ab28f7d4ca6191 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Mon, 18 Mar 2024 16:33:40 -0400 Subject: [PATCH] chore: open api --- mobile/openapi/doc/CreateLibraryDto.md | 2 +- .../ValidateLibraryImportPathResponseDto.md | 2 +- .../openapi/lib/model/create_library_dto.dart | 19 +++++-------------- ...date_library_import_path_response_dto.dart | 3 ++- open-api/typescript-sdk/src/fetch-client.ts | 4 ++-- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/mobile/openapi/doc/CreateLibraryDto.md b/mobile/openapi/doc/CreateLibraryDto.md index e0caf1c8a5b33..94e96493ecd5e 100644 --- a/mobile/openapi/doc/CreateLibraryDto.md +++ b/mobile/openapi/doc/CreateLibraryDto.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **isVisible** | **bool** | | [optional] **isWatched** | **bool** | | [optional] **name** | **String** | | [optional] -**ownerId** | **String** | | [optional] +**ownerId** | **String** | | **type** | [**LibraryType**](LibraryType.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/mobile/openapi/doc/ValidateLibraryImportPathResponseDto.md b/mobile/openapi/doc/ValidateLibraryImportPathResponseDto.md index 4601d8d2f2547..1ebcb04efdca9 100644 --- a/mobile/openapi/doc/ValidateLibraryImportPathResponseDto.md +++ b/mobile/openapi/doc/ValidateLibraryImportPathResponseDto.md @@ -9,7 +9,7 @@ import 'package:openapi/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **importPath** | **String** | | -**isValid** | **bool** | | [optional] [default to false] +**isValid** | **bool** | | [default to false] **message** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/mobile/openapi/lib/model/create_library_dto.dart b/mobile/openapi/lib/model/create_library_dto.dart index ef656ea2a3f2b..24cc04530081a 100644 --- a/mobile/openapi/lib/model/create_library_dto.dart +++ b/mobile/openapi/lib/model/create_library_dto.dart @@ -18,7 +18,7 @@ class CreateLibraryDto { this.isVisible, this.isWatched, this.name, - this.ownerId, + required this.ownerId, required this.type, }); @@ -50,13 +50,7 @@ class CreateLibraryDto { /// String? name; - /// - /// Please note: This property should have been non-nullable! Since the specification file - /// does not include a default value (using the "default:" property), however, the generated - /// source code must fall back to having a nullable type. - /// Consider adding a "default:" property in the specification file to hide this note. - /// - String? ownerId; + String ownerId; LibraryType type; @@ -78,7 +72,7 @@ class CreateLibraryDto { (isVisible == null ? 0 : isVisible!.hashCode) + (isWatched == null ? 0 : isWatched!.hashCode) + (name == null ? 0 : name!.hashCode) + - (ownerId == null ? 0 : ownerId!.hashCode) + + (ownerId.hashCode) + (type.hashCode); @override @@ -103,11 +97,7 @@ class CreateLibraryDto { } else { // json[r'name'] = null; } - if (this.ownerId != null) { json[r'ownerId'] = this.ownerId; - } else { - // json[r'ownerId'] = null; - } json[r'type'] = this.type; return json; } @@ -129,7 +119,7 @@ class CreateLibraryDto { isVisible: mapValueOfType(json, r'isVisible'), isWatched: mapValueOfType(json, r'isWatched'), name: mapValueOfType(json, r'name'), - ownerId: mapValueOfType(json, r'ownerId'), + ownerId: mapValueOfType(json, r'ownerId')!, type: LibraryType.fromJson(json[r'type'])!, ); } @@ -178,6 +168,7 @@ class CreateLibraryDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { + 'ownerId', 'type', }; } diff --git a/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart b/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart index 1297c824c21c5..142055f2cd7ee 100644 --- a/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart +++ b/mobile/openapi/lib/model/validate_library_import_path_response_dto.dart @@ -67,7 +67,7 @@ class ValidateLibraryImportPathResponseDto { return ValidateLibraryImportPathResponseDto( importPath: mapValueOfType(json, r'importPath')!, - isValid: mapValueOfType(json, r'isValid') ?? false, + isValid: mapValueOfType(json, r'isValid')!, message: mapValueOfType(json, r'message'), ); } @@ -117,6 +117,7 @@ class ValidateLibraryImportPathResponseDto { /// The list of required keys that must be present in a JSON. static const requiredKeys = { 'importPath', + 'isValid', }; } diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index 6a660f4e1bce0..6b50642520090 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -466,7 +466,7 @@ export type CreateLibraryDto = { isVisible?: boolean; isWatched?: boolean; name?: string; - ownerId?: string; + ownerId: string; "type": LibraryType; }; export type UpdateLibraryDto = { @@ -491,7 +491,7 @@ export type ValidateLibraryDto = { }; export type ValidateLibraryImportPathResponseDto = { importPath: string; - isValid?: boolean; + isValid: boolean; message?: string; }; export type ValidateLibraryResponseDto = {