fix(appsync): require a format for type updates (#8149)

This commit is contained in:
Jackson Price authored and GitHub committed 2026-11-12 16:17:42 -04:00
1 parent 0924e6a46d
commit c0ef5b2bfd
5 files changed
+41 -9

No files matched your search

@@ -616,16 +616,18 @@ public class AppSyncService {
public synchronized AppSyncType updateType(String apiId, String typeName, Map<String, Object> request) {
assertSchemaNotBusy(apiId);
AppSyncType existing = getType(apiId, typeName);
TypeFormat format = request.containsKey("format") ? parseEnum(TypeFormat.class, request.get("format")) : null;
Object formatValue = request.get("format");
if (formatValue == null) {
throw new AwsException("BadRequestException", "A type format is required", 400);
}
TypeFormat format = parseEnum(TypeFormat.class, formatValue);
if (request.containsKey("definition")) {
existing.setDefinition((String) request.get("definition"));
}
if (request.containsKey("description")) {
existing.setDescription((String) request.get("description"));
}
if (request.containsKey("format")) {
existing.setFormat(format);
}
existing.setFormat(format);
typeStore.put(apiKey(apiId, typeName), existing);
return existing;
}