serverpod_serialization library

Classes

BadRequestMessage
A message sent when a bad request is received.
Bit
Represents a binary vector, where each element is either true or false.
CloseMethodStreamCommand
A message sent over a websocket connection to close a websocket stream of data to an endpoint method.
HalfVector
Represents a vector of half-precision float values.
MethodStreamMessage
A message sent to a method stream.
MethodStreamSerializableException
A serializable exception sent over a method stream.
OpenMethodStreamCommand
A message sent over a websocket connection to open a websocket stream of data to an endpoint method.
OpenMethodStreamResponse
A message sent over a websocket connection to respond to an OpenMethodStreamCommand.
PingCommand
A message sent over a websocket connection to check if the connection is still alive. The other end should respond with a PongCommand.
PongCommand
A response to a PingCommand.
ProtocolSerialization
The ProtocolSerialization defines a toJsonForProtocol method which makes it possible to limit what fields are serialized
SerializableEntity
DEPRECATED: This class is deprecated and will be removed in version 2.1. Please implement the SerializableModel interface instead for creating serializable models.
SerializableModel
The SerializableModel is the base interface for all serializable objects in Serverpod, except primitives.
SerializationManager
The SerializationManager is responsible for creating objects from a serialization, but also for serializing objects. This class is typically extended by generated code.
SparseVector
Represents a sparse vector that stores only non-zero elements.
Uuid
uuid for Dart Author: Yulian Kuncheff Released under MIT License.
UuidValue
Vector
Represents a vector of double values.
WebSocketMessage
Base class for messages sent over a WebSocket connection.
WebSocketMessageInfo
Interface of WebSocketMessage subclasses that have endpoint, method and connection id info.

Enums

CloseReason
The reason a stream was closed.
Namespace
RFC4122 & RFC9562 provided namespaces for v3, v5, and v8 namespace based UUIDs
OpenMethodStreamResponseType
The response to an OpenMethodStreamCommand.
ValidationMode
The options for UUID Validation strictness

Extensions

Base64Dec on String
Extension for decoding ByteData in protocol.
Base64Enc on ByteData
Extension for encoding ByteData in the protocol.
BigIntJsonExtension on BigInt
Expose toJson on BigInt Expose static fromJson builder
BitJsonExtension on Bit
Expose toJson on Bit
ByteDataJsonExtension on ByteData
Expose toJson on ByteData Expose static fromJson builder
CloneBit on Bit
Adds clone method that create a deep copy of a Bit vector.
CloneByteData on ByteData
Adds clone method that create a deep copy of a ByteData.
CloneHalfVector on HalfVector
Adds clone method that create a deep copy of a HalfVector.
CloneSparseVector on SparseVector
Adds clone method that create a deep copy of a SparseVector.
CloneVector on Vector
Adds clone method that create a deep copy of a ByteData.
DateTimeJsonExtension on DateTime
Expose toJson on DateTime Expose static fromJson builder
DurationJsonExtension on Duration
Expose toJson on Duration Expose static fromJson builder
HalfVectorJsonExtension on HalfVector
Expose toJson on HalfVector
ListJsonExtension on List<T>
Expose toJson on List
MapJsonExtension on Map<K, V>
Expose toJson on Map
SetJsonExtension on Set<T>
Expose toJson on Set
SparseVectorJsonExtension on SparseVector
Expose toJson on SparseVector
UriJsonExtension on Uri
Expose toJson on Uri Expose static fromJson builder
UuidValueJsonExtension on UuidValue
Expose toJson on UuidValue Expose static fromJson builder
VectorJsonExtension on Vector
Expose toJson on Vector

Constants

autoSerializedTypes → const List<String>
All datatypes that are serialized by default. Used internally in Serverpod code generation.
basicAuthSchemeName → const String
The name of the default Serverpod scheme for HTTP "authorization" headers. Note, the scheme name is case-insensitive and should be compared in a case-insensitive manner.
extensionSerializedTypes → const List<String>
All datatypes that has extensions to support serialization. Used internally in Serverpod code generation.
hasCloneExtensionTypes → const List<String>
List of types that has a clone method extension and therefore can be copied by calling clone().

Properties

nonMutableTypeNames List<String>
List of types that are not mutable and therefore do not need to be copied or handled in a copyWith method.
final

Functions

getType<T>() Type
Get the type provided as an generic. Useful for getting a nullable type.
isValidAuthHeaderValue(String value) bool
Returns true if the provided value is a valid HTTP "authorization" header value (which includes starting with an authentication scheme name).
isWrappedBasicAuthHeaderValue(String value) bool
Returns true if the provided value is a Serverpod-wrapped auth key.
unwrapAuthHeaderValue(String? authValue) String?
Returns the auth key from an auth value that has potentially been wrapped. This operation is the inverse of wrapAsBasicAuthHeaderValue. If null is provided, null is returned.
wrapAsBasicAuthHeaderValue(String key) String
Returns a value that is compliant with the HTTP auth header format by encoding and wrapping the provided auth key as a Basic auth value.

Exceptions / Errors

AuthHeaderEncodingException
An exception thrown upon erroneous encoding of an auth header.
DeserializationTypeNotFoundException
Exception thrown when no deserialization type was found during protocol deserialization
SerializableException
This is SerializableException that can be used to pass Domain exceptions from the Server to the Client
UnknownMessageException
Exception thrown when an unknown message is received.