All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- JSON fields that have
@(This.Default)
and are set to their default value, are not encoded. This does not apply to fields that are marked with a nonstandard default value, such as@(This.Default!1)
!
- Support DMD 2.100.
- Improve quality of float/double encoding.
- XML: Handle
Nullable
values as empty tags, if they're not@Default
.
- JSON: Encode
Nullable.null
asnull
.
- When an invariant is violated while JSON decoding a type, we now throw a parser exception.
Note that this will not work in
-release
and is hence fundamentally dangerous! However, if you never use-release
anyways, it's fine.
- Simplify internal copy of std_data_json: remove support for strings other than
string
. This avoids a linker error on 2.099.1.
- Fix DMD 2.099.1 DIP1000 support.
- decodeJson: add forgotten parameter
- JSON: Allow encoding std.sumtype values with a transform function.
- Avoid consuming 'streamCopy' in alias-this resolution.
- Remove sumtype dependency. Use std.sumtype. Limit unit-threaded dependency to unittest.
- Encode null classes as JSON "null".
- Decode JSON "null" to null classes.
text.json.Decode
: Only check for object null once we actually try to directly recurse into it. Allows null objects to be encoded with an encode function.
- Fix: check that isCallable can be instantiated before trying to instantiate it. Clarifies a compile error in JSON decoders.
- Allow decoding immutable
ParserMarker
.
- Avoid combinatorial explosion if decoder fails to instantiate in deep recursion.
- XML: Decode arrays of SumTypes.
- text.json.Encode: create fast path for
SysTime
. (This type is very common.)
- Add
text.json.ParserMarker
, a type that can be thrown into a decoded struct to match any JSON value. As opposed toJSONValue
,ParserMarker
just skips the region in the input stream without parsing. Later on, you can callmarker.decode!(T, handler)
to resume parsing inside the marker. Note that while faster than parsing, skipping in the input stream is not free! The JSON will still need to be lexed. Only useParserMarker
if there is no way to know the full type of the message at the time.
- Avoid combinatorial explosion if decoder fails to instantiate in deep recursion.
- Work around DMD 2.097.2 issue where a
FindChildrenRange
related symbol would not be found.
- Allow decoding a struct member that is a struct with an immutable hashmap aliased to
this
.
- Allow decoding a struct member that is an immutable hashmap.
- Work around DMD 2.097.0 regression https://issues.dlang.org/show_bug.cgi?id=22214 .
- Update dub boilerplate requirement. Commit dub.selections.json for reproducible unittests.
- Fix deprecations and breakage on DMD 2.097.0.
- Fix that decoding of nested object in array from JSONValue with alias this would drop every second value.
- Support
@(Xml.Element)
/@(Xml.Attribute)
without a name. ForXml.Element
, the name of the type is used. ForXml.Attribute
, the name of the field is used.
- When encountering a JSON decoding compile error, log the sequence of types that led to the error.
- json: Throw
JSONException
when attempting to decode non-object as object.
- Improve error handling in
text.json.Enum
.
- add
text.json.Enum
with helper functions to encode and decode enums into JSON-style "SCREAMING_SNAKE_CASE" strings.
- fix depreation for 2.094.1
- Allow decoding of immutable associative arrays.
- Revert 1.1.3
- Implement different solution: remove problematic
foreach (...; readArray)
.
- Support
decode!(const JSONValue)
.
- Fix typo in
text.json.Encode
.
- Fix JSON encoding of classes.
- Remove pointless
@disable this(this)
that was breaking array-of-struct decoding.
- Remove file that was breaking LDC build via ldc-developers/ldc#3344 .
- Include a copy of std_data_json and taggedalgebraic directly. Work around DMD bug 21235 by hacking opEquals to be non-templated. This change should be reverted once the upstream issues are fixed. (Hah. Right.)
- Allow loading any type with a
fromString
static method from a string, such as an XML attribute.
- Remember to pop stream for numbers when decoding JSONValue.
- Initial version: move text.xml, text.json over from internal Utilities repo; switch json decoding to stdx_data_json.