RestSerializable class

An annotation used to specify a class to generate code for.

Creates a serialize/deserialize function for JSON.

Heavily borrowed/inspired by JsonSerializable

Constructors

RestSerializable({String endpoint, FieldRename fieldRename, String fromKey, bool nullable, String toKey})
Creates a new RestSerializable instance.
const

Properties

endpoint String
Callback to produce a REST path from a Query. An instance argument is provided only when it is available to the invoking repository method (i.e. upsert or delete). [...]
final
fieldRename FieldRename
Defines the automatic naming strategy when converting class field names into JSON map keys. [...]
final
fromKey String
When deserializing from REST, the response may be nested within a top level key. If no key is defined, the first value will be returned. This configuration is overriden when a query specifies providerArgs['topLevelKey']. [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
nullable bool
When true (the default), null fields are handled gracefully when decoding null and nonexistent values from JSON. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
toKey String
When serializing to REST, the payload may need to be nested within a top level key. [...]
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

defaults → const RestSerializable
An instance of RestSerializable with all fields set to their default values.
const RestSerializable(fieldRename: FieldRename.snake, nullable: false)