json_serializer library

This library provides JSON serialization and deserialization functionality.

Classes

CamelCaseConvention
CamelCase naming convention (e.g., firstName, lastName). This is the default Dart convention.
EnumType<T extends Enum>
Represents an enumeration type.
JsonConverter<T>
The base class for all JSON converters. A JSON converter is responsible for converting a specific data type to and from JSON.
JsonSerializer
A class that provides JSON serialization and deserialization functionality.
JsonSerializerOptions
Options for the JSON serializer.
KebabCaseConvention
Kebab-case naming convention (e.g., first-name, last-name). Common in URLs, HTML attributes, and some APIs.
LowerCaseConvention
lowercase naming convention (e.g., firstname, lastname).
NamingConvention
This file contains the implementation of various naming conventions used in JSON serialization. Each convention is responsible for converting between different naming styles. The base class for all naming conventions. A naming convention is responsible for converting property names between different styles.
PascalCaseConvention
PascalCase naming convention (e.g., FirstName, LastName). Common in C#, .NET, and some APIs.
Serializable
An abstract class that represents a serializable object.
SnakeCaseConvention
Snake_case naming convention (e.g., first_name, last_name). Common in Python, Ruby, and many REST APIs.
UpperCaseConvention
UPPERCASE naming convention (e.g., FIRSTNAME, LASTNAME).
UserType<T>
Represents a user-defined type.

Functions

deserialize<T>(String json, [JsonSerializerOptions? options]) → T
Deserializes the given json string to an object of type T.
serialize(Object? object, [JsonSerializerOptions? options]) String
Serializes the given object to a JSON string.

Exceptions / Errors

JsonSerializerException
Exception thrown when there is an error during JSON serialization.