applyToRemoteDeserialization property

bool applyToRemoteDeserialization
final

When true (the default), where will be used to fetch associations by their defined keys. This is useful when remote data is provided as an index instead of as fully-formed association data.

For example, given the API: {"classField" : true, "assoc": { "id": 12345 }} and the where configuration {'id' : "data['assoc']['id']"}, a REST adapter would generate

await repository?.getAssociation<Association>(
  Query(where: [Where.exact('id', data['assoc']['id])], providerArgs: {'limit': 1})
)

When false, the output would generate assuming the full payload is present. Given the API {"classField" : true, "assoc": { "id": 12345, "name": "class name" }}, a REST adapter would generate

await AssociationAdapter().fromRest(data['assoc'], provider: provider, repository: repository))

Implementation

final bool applyToRemoteDeserialization;