JSON Contracts, Methods, and Input Boundaries
Review runtime schemas, patch formats, unknown fields, parser differences, and bounded input before a request becomes an operation.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
JSON syntax is only the first boundary
A JSON parser converts bytes into values: strings, numbers, booleans, null, arrays, and objects. A runtime schema decides which of those values an operation accepts. Neither step establishes who may perform the operation. A schema-valid customerId can still name someone else's customer.
Start with an ordinary report request. The customer selects a search term and a page size. The server supplies the tenant from verified membership.
{ "search": "annual", "pageSize": 25, "sort": "created_desc" }
Changing search to an object changes its type, not just its text. Changing pageSize to a million changes the amount of work. Adding tenantId introduces a property the public operation did not promise to accept. These are different decisions and deserve separate failures.