-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Right now, if a json has an invalid field in it, serde does not throw an error. The deserializer just skips that field.
For example, if you want to configure the VM with vcpu_count=3 and mem_size_mib=256, but you reverse two letters (which isn't exactly unlikely), the request will be successful, but only the vcpu_count will be updated in this example:
curl --unix-socket /tmp/firecracker.socket -i -X GET "http://localhost/machine-config" -H "accept: application/json" -H "Content-Type: application/json" => {"vcpu_count": 1, "mem_size_mib": 128 ...}
curl --unix-socket /tmp/lambda.socket -i
-X PUT "http://localhost/machine-config"
-H "accept: application/json"
-H "Content-Type: application/json"
-d "{
"vcpu_count": 3,
"mem_size_mbi": 3906,
}"
curl --unix-socket /tmp/firecracker.socket -i -X GET "http://localhost/machine-config" -H "accept: application/json" -H "Content-Type: application/json" => {"vcpu_count": 3, "mem_size_mib": 128 ...}