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'),
),
])
..methods.addAll([
Method(
Constructor(
(final b) => b
..static = true
..factory = true
..name = 'fromJson'
..lambda = true
..returns = refer('${state.prefix}$identifier')
..requiredParameters.add(
Parameter(
(final b) => b
..name = 'json'
..type = refer('Object'),
..type = refer('Map<String, dynamic>'),
),
)
..body = const Code('jsonSerializers.deserializeWith(serializer, json)!'),
),
])
..methods.addAll([
Method(
(final b) => b
..name = 'toJson'

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

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