Browse Source

Merge pull request #331 from Leptopoda/fix/nextcloud_toJson

dynamite, nextcloud: make fromJson a factory instead of a static method
pull/335/head
Nikolas Rimikis 2 years ago committed by GitHub
parent
commit
482bff006d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/dynamite/dynamite/lib/src/openapi_builder.dart
  2. 448
      packages/nextcloud/lib/src/nextcloud.openapi.dart

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

@ -1276,23 +1276,22 @@ TypeResult resolveObject(
) )
..redirect = refer('_\$${state.prefix}$identifier'), ..redirect = refer('_\$${state.prefix}$identifier'),
), ),
]) Constructor(
..methods.addAll([
Method(
(final b) => b (final b) => b
..static = true ..factory = true
..name = 'fromJson' ..name = 'fromJson'
..lambda = true ..lambda = true
..returns = refer('${state.prefix}$identifier')
..requiredParameters.add( ..requiredParameters.add(
Parameter( Parameter(
(final b) => b (final b) => b
..name = 'json' ..name = 'json'
..type = refer('Object'), ..type = refer('Map<String, dynamic>'),
), ),
) )
..body = const Code('jsonSerializers.deserializeWith(serializer, json)!'), ..body = const Code('jsonSerializers.deserializeWith(serializer, json)!'),
), ),
])
..methods.addAll([
Method( Method(
(final b) => b (final b) => b
..name = 'toJson' ..name = 'toJson'

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

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