Validates if a value has only specified properties.