A security architect is reviewing an Infrastructure as Code (IaC) template written in JSON. The architect notes that a field intended to specify the number of CPU cores, cpu_cores, is set to "4" (a string) instead of 4 (a number). The deployment tool accepted the template without generating a type error. Which of the following BEST explains why this misconfiguration was not automatically detected?
JSON automatically performs type coercion, converting the string "4" to the number 4 during parsing.
The JSON standard requires parsers to accept numeric strings as valid substitutes for number types.
The IaC tool's parser is designed to be fault-tolerant and ignores all data type definitions.
JSON does not natively enforce data type schemas, so an explicit validation mechanism is required to catch such errors.
The JSON data-interchange format defines syntax for basic data types like strings, numbers, and booleans, but it does not include a native mechanism for schema enforcement. This means JSON itself does not validate that a specific key has a value of a specific type (e.g., ensuring cpu_cores is a number). To prevent such type-related misconfigurations, a separate validation layer, such as JSON Schema, must be implemented by the application or tool processing the JSON data. The IaC tool likely accepted the string value because it either lacks strict type checking for that field or performs type coercion.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is JSON Schema and how does it enforce validation?
Open an interactive chat with Bash
Why doesn’t JSON enforce a strict schema by default?
Open an interactive chat with Bash
How can type-checking be implemented in JSON automation workflows?