Browse Source

dynamite,nextcloud: Fix non-required object fields with toJsonString

pull/165/head
jld3103 2 years ago
parent
commit
e40f6f174a
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 6
      packages/dynamite/lib/src/openapi_builder.dart
  2. 503
      packages/nextcloud/lib/src/nextcloud.openapi.dart

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

@ -1131,17 +1131,17 @@ TypeResult resolveObject(
Method( Method(
(final b) => b (final b) => b
..name = 'toJsonString' ..name = 'toJsonString'
..returns = refer('String') ..returns = refer('String?')
..lambda = true ..lambda = true
..static = true ..static = true
..requiredParameters.add( ..requiredParameters.add(
Parameter( Parameter(
(final b) => b (final b) => b
..name = 'data' ..name = 'data'
..type = refer(identifier), ..type = refer(_makeNullable(identifier, true)),
), ),
) )
..body = const Code('json.encode(data.toJson())'), ..body = const Code('data == null ? null : json.encode(data.toJson())'),
), ),
]) ])
..fields.addAll([ ..fields.addAll([

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save