Browse Source

Merge pull request #139 from provokateurin/feature/print-data-on-assert-fail

dynamite,nextcloud: Print data on failed asserts
pull/140/head
Kate 2 years ago committed by GitHub
parent
commit
f023c8e39c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/dynamite/lib/src/openapi_builder.dart
  2. 4
      packages/nextcloud/lib/src/nextcloud.openapi.dart

4
packages/dynamite/lib/src/openapi_builder.dart

@ -1284,10 +1284,10 @@ TypeResult resolveType(
'}', '}',
], ],
if (schema.oneOf != null) ...[ 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) ...[ 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(', 'return $identifier(',
'data,', 'data,',

4
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -2821,7 +2821,7 @@ class CoreNavigationApps_Ocs_Data_Order {
try { try {
string = (data as String); string = (data as String);
} catch (_) {} } 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( return CoreNavigationApps_Ocs_Data_Order(
data, data,
$int: $int, $int: $int,
@ -3968,7 +3968,7 @@ class UserStatusClearAt_Time {
try { try {
$int = (data as int); $int = (data as int);
} catch (_) {} } 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( return UserStatusClearAt_Time(
data, data,
userStatusClearAtTime0: userStatusClearAtTime0, userStatusClearAtTime0: userStatusClearAtTime0,

Loading…
Cancel
Save