Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate error messages after processing all the validator plugins #77

Open
slopjong opened this issue Jun 10, 2013 · 2 comments
Open

Comments

@slopjong
Copy link

Arrays lead to duplicate error messages.

Example:

Invalid value(s) for 'sensors.temperature.unit', allowed values are: °C, °F, K, °De, °N, °Ré, °Rø
Property 'sensors.temperature[0].location' is missing.
Invalid value(s) for 'sensors.temperature.unit', allowed values are: °C, °F, K, °De, °N, °Ré, °Rø
Property 'sensors.temperature[1].location' is missing.
Invalid value(s) for 'sensors.barometer.unit', allowed values are: hPA
Property 'sensors.barometer[0].location' is missing.
Property 'sensors.humidity[0].unit' is missing.
Property 'sensors.humidity[0].location' is missing.
Property 'sensors.humidity[1].unit' is missing.
Property 'sensors.humidity[1].location' is missing.
Property 'sensors.wind[0].properties' is missing.
Property 'sensors.wind[0].location' is missing.
@slopjong
Copy link
Author

The solution is to replace [0] with [] and then make the array elements uniq.

@slopjong
Copy link
Author

The previous commentor didn't consider that it makes sense to tell the user what sensor instance is falsy. If the number of lines should be reduced then sum the error messages up as shown here:

Property 'sensors.humidity[].unit' is missing. Check sensor instance #1, #2 and #3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant