vibe.d icon indicating copy to clipboard operation
vibe.d copied to clipboard

incorrect serialization of header parameters

Open ferencdg opened this issue 4 years ago • 0 comments

when using @headerParam("paramName", "fieldName") the value of paramName parameter is ALWAYS serialized by calling 'to!string', but deserialized by calling 'fromRestString' which in turn might use json deserializer.

Sending the following simple struct as a header parameter would cause runtime error:

struct TestStruct
{
    ubyte[] payload;
}

That is because vibe.d would try to deserialize using the json deserializer. As a workaround people have to define 'fromString' or 'fromISOExtString' for TestStruct

ferencdg avatar Jan 04 '21 14:01 ferencdg