refactor(ses): build the empty bulk TemplateName violation with SmithyValidationErrors (#9319)

The v2 SendBulkEmail refusal of an empty DefaultContent.Template.TemplateName now builds its violation with SmithyValidationErrors.Violations.WITHOUT_VALUES.lengthTooShort instead of writing the sentence out, as the bulkEmailEntries check beside it does with notNullWithoutValue. The message is unchanged.
This commit is contained in:
Kenshin Okinaka authored and GitHub committed 2026-11-23 23:11:20 -04:00
1 parent ddad3ca1df
commit c97f45c6f6
1 file changed
+2 -2
@@ -231,8 +231,8 @@ public class SesSendController {
validateTrackingOverrides(request);
JsonNode defaultTemplateName = request.path("DefaultContent").path("Template").path("TemplateName");
if (defaultTemplateName.isTextual() && defaultTemplateName.textValue().isEmpty()) {
throw SmithyValidationErrors.badRequest("Value at 'defaultContent.template.templateName' failed to "
+ "satisfy constraint: Member must have length greater than or equal to 1");
throw SmithyValidationErrors.badRequest(SmithyValidationErrors.Violations.WITHOUT_VALUES
.lengthTooShort("defaultContent.template.templateName", "", 1));
}
JsonNode bulkEntries = request.path("BulkEmailEntries");
if (bulkEntries.isMissingNode() || bulkEntries.isNull()) {