Skip to content

Cannot serialize Duration #4

@fyfrey

Description

@fyfrey

Hi,
asdf fails to serialize a struct with phobos Duration in it:

/+dub.sdl:
dependency "asdf" version="~>0.5.7"
+/
import std.stdio;
import std.datetime;
import asdf;
void main()
{
    A a;
    string json = serializeToJsonPretty(a); // never ends
    writeln("json length ", json.length);
}

struct A
{
    Duration dur;
}

This errors with an OOM exception in the appender. Somehow in writes never-ending zero": { strings to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions