Property value parsing and validation should to be implemented in the backend, and should be removed from JavaScript. Here's a few reasons:
- the web API has to validate input; validation needs parsing.
- we could restrict the API to a very simple format. This forces bot authors to re-implement the parsing functionality in order to created the form we'd required for the API from their input (notably, from Wikipedia)
- the backend needs to be able to render/format all values, for (non-JS) display, RDF output, etc. Output formats should be parseable, providing round-trip functionality. This is much easier if rendering and parsing is implemented in the same place.
- parsing and formatting should only be implemented once, if at all possible.
In the backend, I suggest to allow any number of parsers for each data format. Try each parser, until one accepts the input.
Version: unspecified
Severity: normal
Whiteboard: u=dev c=story p=0
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49265
https://bugzilla.wikimedia.org/show_bug.cgi?id=56261