Class

SerializedCrudContract

SerializedCrudContract(name, clazz) → {void}

Constructor

# new SerializedCrudContract(name, clazz) → {void}

Exposes the same CRUD operations as FabricCrudContract but takes and returns JSON strings to facilitate simple client interactions.

CRUD contract variant that serializes/deserializes payloads

Parameters:
Name Type Description
name string

The contract name

clazz Constructor.<M>

The model constructor used to instantiate models from JSON

View Source contracts/crud/serialized-crud-contract.ts, line 10

void
Example
const contract = new SerializedCrudContract<MyModel>('MyModelContract', MyModel);
// Client submits JSON string payloads and receives JSON string responses