split strings from other types that need xml serialization

This commit is contained in:
Emil Lerch 2025-04-18 11:21:42 -07:00
parent 0a21a9f184
commit 52f99bb35f
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -243,7 +243,20 @@ pub fn Request(comptime request_action: anytype) type {
// the http_payload declaration on the request type. // the http_payload declaration on the request type.
// Hopefully these will always be ?[]const u8, otherwise // Hopefully these will always be ?[]const u8, otherwise
// we should see a compile error on this line // we should see a compile error on this line
aws_request.body = @field(request, ActionRequest.http_payload).?; const payload = @field(request, ActionRequest.http_payload);
const T = @TypeOf(payload);
var body_assigned = false;
if (T == ?[]const u8) {
aws_request.body = payload.?;
body_assigned = true;
}
if (T == []const u8) {
aws_request.body = payload;
body_assigned = true;
}
if (!body_assigned)
return error.XmlSerializationNotImplemented;
} else { } else {
return error.NotImplemented; return error.NotImplemented;
} }