Browse Source

dynamite, nextcloud: make fromJson a factory instead of a static method

pull/331/head
Nikolas Rimikis 2 years ago
parent
commit
7a9eea8d43
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  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