diff --git a/source/jstruct/deserializer.d b/source/jstruct/deserializer.d index 2b24566..62384e2 100644 --- a/source/jstruct/deserializer.d +++ b/source/jstruct/deserializer.d @@ -2,19 +2,18 @@ module jstruct.deserializer; import std.json; import jstruct.exceptions : SerializationError; - import std.traits : FieldTypeTuple, FieldNameTuple; /** - * Deserializes the provided JSON into a struct of type RecordType - * - * Params: - * jsonIn = the JSON to deserialize - * Throws: - * RemoteFieldMissing = if the field names in the provided RecordType - * cannot be found within the prpvided JSONValue `jsonIn`. - * Returns: an instance of RecordType - */ + * Deserializes the provided JSON into a struct of type RecordType + * + * Params: + * jsonIn = the JSON to deserialize + * Throws: + * RemoteFieldMissing = if the field names in the provided RecordType + * cannot be found within the prpvided JSONValue `jsonIn`. + * Returns: an instance of RecordType + */ public RecordType fromJSON(RecordType)(JSONValue jsonIn) { RecordType record; diff --git a/source/jstruct/serializer.d b/source/jstruct/serializer.d index ed492e8..fe8a5de 100644 --- a/source/jstruct/serializer.d +++ b/source/jstruct/serializer.d @@ -3,8 +3,15 @@ module jstruct.serializer; import std.json; import std.conv : to; import std.traits : FieldTypeTuple, FieldNameTuple; - import std.traits : isArray; +import std.traits : isArray; +/** + * Serializes the provided record into JSON + * + * Params: + * record = the record to serialize into + * Returns: A `JSONValue` containing the serialized record + */ public JSONValue serializeRecord(RecordType)(RecordType record) { // Final JSON to submit