[Validator] Fixed string conversion in constraint violations

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10675
| License       | MIT
| Doc PR        | -
I agree with both of you @webmozart and @Tobion!

If this is displayed to the end users, we should not be too precise; so the resource id is not needed, but I would even say that displaying `array`, `object`, or `resource` to the end user looks weird as he probably did not enter that in a form value anyway.