The spec states that:
The value of the type attribute MUST be either a) …, or b) one and only one resource type definition map.
The value of the is attribute MUST be an array of any number of elements, each of which MUST be a) …, or b) one or more trait definition maps.
So far, so good. If we come across a map in a type or is attributes, then they will be a type definition and a trait definitions.
But the spec also says:
To pass parameter values to resource types and traits, use a map when declaring the resource type or trait to be used.
Now we can’t easily tell whether a map in a type or is attribute is a resource type/trait name with parameters or a definition.
We can try to guess. types/traits names with arguments will consist of an object with a single property with a value that is a map, and the single property must exist in the top-level resouceTypes/traits attributes. But maybe there is a typo, in which case we’ll end up parsing the definition as a resource type or trait, maybe generating an error, maybe not.