ditto
import text.json.Encode : encodeJson; enum Enum { testValue, isHttp, } alias encode = encodeEnum!Enum; encodeJson!(Enum, encode)(Enum.testValue).should.be(JSONValue("TEST_VALUE")); encodeJson!(Enum, encode)(Enum.isHttp).should.be(JSONValue("IS_HTTP"));
Helper to encode a DStyle enum ("entryName") as JSON style ("ENTRY_NAME").
Use like so: alias encode = encodeEnum!EnumType; when forming your encode overload.