appstream icon indicating copy to clipboard operation
appstream copied to clipboard

Add back XSD file (or other definitely parseable schema)

Open marcusmueller opened this issue 5 years ago • 0 comments

In reaction to #167, the XSD file was removed – understandably, I might add, since maintaining that separately from a manual validator is a hassle.

However, that was a bad move, in my humble opinion. Now, the docs deviate from the output of validate (#278), and neither indicates whether the document is actually valid for any downstream parsers that aren't this software in itself.

Also, the majority of the issues on this tracker are request for new field or property types. Thus, as an external observer it seems that the grunt of the maintenance work is to maintain the scheme, not the parser for the same.

And I greatly appreciate this – this is mostly about defining a metadata format that different consumers need to parse and multiple tools should be able to produce; the less clear it is to me why the validator is not doing a syntactic check based on e.g. a DTD (which libxml2 does out of the box) or XSD.

That would allow me to look up things that aren't well-defined in the docs (which is understandable - documentation is for humans, but strict metadata schemes require rules, which are hard to put in still human-consumable text), for example, whether or not I can have multiple tags of some type (contact URLs), whether or not <project_group/> should actually be a content-free tag, as the writing <tagname/> suggests in the docs, or contain some CDATA and so on. I just tried to write one metainfo file, and was met with multiple issues. I can look up how other files handle this – but who tells me these files weren't simply written before appstreamcli validate got a check that checks for what they shouldn't be doing?

Please, instead of having a 2104 line as_validator.c strive to put validation back into the hands of a tool that was designed for more than one project. Also, clearly version that file with releases, please.

marcusmueller avatar Jul 04 '20 13:07 marcusmueller