From 32260099e1e916fe4eb99f6cc5bf9d9bd2ede890 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 30 Nov 2022 12:37:19 +0100 Subject: [PATCH] dynamite,nextcloud: Print data on failed asserts --- packages/dynamite/lib/src/openapi_builder.dart | 4 ++-- packages/nextcloud/lib/src/nextcloud.openapi.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index 272a4b8f..a6088b06 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -1284,10 +1284,10 @@ TypeResult resolveType( '}', ], if (schema.oneOf != null) ...[ - "assert([${fields.values.join(',')}].where((final x) => x != null).length == 1, 'Need oneOf');", + "assert([${fields.values.join(',')}].where((final x) => x != null).length == 1, 'Need oneOf for \$data');", ], if (schema.allOf != null) ...[ - "assert([${fields.values.join(',')}].where((final x) => x != null).length == ${fields.length}, 'Need allOf');", + "assert([${fields.values.join(',')}].where((final x) => x != null).length == ${fields.length}, 'Need allOf for \$data');", ], 'return $identifier(', 'data,', diff --git a/packages/nextcloud/lib/src/nextcloud.openapi.dart b/packages/nextcloud/lib/src/nextcloud.openapi.dart index 59a224c0..44a267c5 100644 --- a/packages/nextcloud/lib/src/nextcloud.openapi.dart +++ b/packages/nextcloud/lib/src/nextcloud.openapi.dart @@ -2821,7 +2821,7 @@ class CoreNavigationApps_Ocs_Data_Order { try { string = (data as String); } catch (_) {} - assert([$int, string].where((final x) => x != null).length == 1, 'Need oneOf'); + assert([$int, string].where((final x) => x != null).length == 1, 'Need oneOf for $data'); return CoreNavigationApps_Ocs_Data_Order( data, $int: $int, @@ -3968,7 +3968,7 @@ class UserStatusClearAt_Time { try { $int = (data as int); } catch (_) {} - assert([userStatusClearAtTime0, $int].where((final x) => x != null).length == 1, 'Need oneOf'); + assert([userStatusClearAtTime0, $int].where((final x) => x != null).length == 1, 'Need oneOf for $data'); return UserStatusClearAt_Time( data, userStatusClearAtTime0: userStatusClearAtTime0,