ae.utils.json

JSON encoding.

Members

Aliases

JsonSerializer
alias JsonSerializer = CustomJsonSerializer!(JsonWriter!StringBuilder)
Undocumented in source.

Functions

NonSerializedFields
string NonSerializedFields(string[] fields)
Undocumented in source. Be warned that the author may not have intended to support it.
jsonParse
T jsonParse(C[] s)
Undocumented in source. Be warned that the author may not have intended to support it.
toJson
string toJson(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
toPrettyJson
string toPrettyJson(T v)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

CustomJsonSerializer
struct CustomJsonSerializer(Writer)
Undocumented in source.
JSONFragment
struct JSONFragment

Fragment of raw JSON. When serialized, the .json field is inserted into the resulting string verbatim, without any validation. When deserialized, will contain the raw JSON of one JSON object of any type.

JSONName
struct JSONName

User-defined attribute - specify name for JSON object field. Useful when a JSON object may contain fields, the name of which are not valid D identifiers.

JSONOptional
struct JSONOptional

User-defined attribute - only serialize this field if its value is different from its .init value.

JSONPartial
struct JSONPartial

User-defined attribute - skip unknown fields when deserializing.

JsonWriter
struct JsonWriter(Output)
Undocumented in source.
PrettyJsonWriter
struct PrettyJsonWriter(Output, alias indent = '\t', alias newLine = '\n', alias pad = ' ')
Undocumented in source.

Templates

NonSerialized
template NonSerialized(fields...)

A template that designates fields which should not be serialized to Json.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>