Why the shape is written down
The shape is the contract of the route. A shape only in the code is a contract only the code knows.
The limit of a type
It checks form, not meaning. A number in range is still a number that can be wrong.
The bytes become a value, and the value has a type. The type is the check, and the check is the reason a wrong request never reaches the logic.
About 1 min of reading
Refuse an unknown field
Write the expected shape
Before you run it, say out loud what it will print. Then open the answer.
Send an extra field
Before you run it, say out loud what it will print. Then open the answer.
Write the error back
Before you run it, say out loud what it will print. Then open the answer.
The shape is the contract of the route. A shape only in the code is a contract only the code knows.
It checks form, not meaning. A number in range is still a number that can be wrong.
An unknown field is an error. A silent ignore is a field that was meant to be read and was not.
A field that is a string where a number is required fails at the decode. The logic never sees it.
The decode error names a field. The name is written to the client, and the client fixes it in one try.
Each one is defined here on this site. Open the entry for the full definition and the other words it points at.