Browse Source

Merge pull request #165 from provokateurin/fix/non-required-object-fields

dynamite,nextcloud: Fix non-required object fields with toJsonString
pull/167/head
Kate 2 years ago committed by GitHub
parent
commit
f7eb1eff1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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