mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(appsync): require a format for type updates (#8149)
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user