Browse Source

dynamite,nextcloud: Print data on failed asserts

pull/139/head
jld3103 2 years ago
parent
commit
32260099e1
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  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) ...[
"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,',

4
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,

Loading…
Cancel
Save