fix GSI output
This commit is contained in:
@@ -290,7 +290,7 @@ serialize_table_metadata :: proc(metadata: ^Table_Metadata) -> ([]byte, bool) {
|
|||||||
}
|
}
|
||||||
strings.write_string(&gsi_builder, "]")
|
strings.write_string(&gsi_builder, "]")
|
||||||
}
|
}
|
||||||
strings.write_string(&gsi_builder, "}")
|
strings.write_string(&gsi_builder, "}}")
|
||||||
}
|
}
|
||||||
strings.write_string(&gsi_builder, "]")
|
strings.write_string(&gsi_builder, "]")
|
||||||
|
|
||||||
|
|||||||
@@ -190,6 +190,15 @@ handle_create_table :: proc(engine: ^dynamodb.Storage_Engine, request: ^HTTP_Req
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if gsi_val, found2 := root["GlobalSecondaryIndexes"]; found2 {
|
||||||
|
if gsi_arr, ok2 := gsi_val.(json.Array); ok2 && len(gsi_arr) > 0 {
|
||||||
|
if _, has := gsis.?; !has {
|
||||||
|
make_error_response(response, .ValidationException, "Invalid GlobalSecondaryIndexes definition")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create the table
|
// Create the table
|
||||||
desc, create_err := dynamodb.create_table(engine, string(table_name), key_schema, attr_defs, gsis)
|
desc, create_err := dynamodb.create_table(engine, string(table_name), key_schema, attr_defs, gsis)
|
||||||
if create_err != .None {
|
if create_err != .None {
|
||||||
|
|||||||
Reference in New Issue
Block a user