Talk:Validator.nu Web Service Interface
From WHATWG Wiki
Implementation feedback
Just for fun I've added sort-of compatible interface to the hCard Validator.
My Suggestions:
- id field for messages, that uniquely identifies each problem (e.g "unknown-attribute"). This may allow clients to ignore certain warnings and accurately aggregate error statistics even if error message contains variable data or simply wording changes.
- if message contains variable data (e.g. "'div' not allowed in 'span'"), the data could be additionally given in a separate array (["div","span"]), to allow clients to localize messages using id + arguments.
- combinations of error types and subtypes are weird. It could be orthogonal severity {fatal|error|warning|info} and type {document|i/o|unsupported}, this way you could e.g. warn about i/o problems (like downgrading of https to http).
- message_html field to allow formatted messages (messages may contain code fragments, abbreviations or links and I'd like to display these nicely to the user)
- field for additional, more verbose message or hint how to fix the problem (html formatted too)
- field for url to the relevant part of the specification
- possibility to specify non-line-oriented error location (in my implementation I don't track line numbers, but I could generate XPath path to the element)
- parse tree might contain code property which is just an XML serialisation of DOM (this is good enough for spotting misinterpreted markup)
- field or naming scheme for implementation-specific data?