Expand description
CloudFormation stringifies all scalar values before sending them to resource
handlers, so 512 and "512" are equivalent. YAML 1.1 also parses yes/no
as booleans. These helpers implement the same loose type semantics so that
constraint checks (min/max, enum, pattern, length) work on coerced values.
Enums§
- Coerce
Result - Result of attempting to coerce a JSON value to match an expected schema type.
Functions§
- coerce_
port_ to_ string - Stringify a value for port-style comparison, accepting only string and integer scalars.
- coerce_
str_ to_ integer - The string arm of
coerce_to_integer, for callers that hold a scalar outside aserde_json::Value(such as the parser’sParseValuevalues). - coerce_
string_ or_ integer_ to_ string - Returns the text authored for a string or integer scalar. Fractional numbers, booleans, nulls, and composite values have no string-or-integer form.
- coerce_
to_ bool - Accepts YAML 1.1 boolean strings in addition to native bools.
- coerce_
to_ integer - coerce_
to_ number - coerce_
to_ string - coerce_
value - Attempt to coerce a JSON value to match the expected schema type.
- scalar_
eq - Whether two values are equal under CloudFormation’s loose scalar semantics.
- type_
compatible - Check if a value is compatible with the expected JSON Schema type using CFN’s loose semantics.