Last modified: 2014-03-04 13:34:33 UTC
Decide on the necessity, and if so, how exactly the API module for value validation (or properly rather value parsing) would be specified, how it interacts with the existing parsing API module, and with a potential formatting API.
Some thoughts: * as a context, we can either provide a data type ID, or, for convenience, a property ID. * we need validation, parsing, and formatting. since we often need combinations of these, they could be combined in a module, so these operations can be performed in a single call. Perhaps like this: - input is either given as JSON, or as a string. In the latter case, it is parsed to get the JSON structure. - a DataValue is constructed from the JSON structure, based on info from the data type. - validation is always performed on the DataValue - the result is the DataValue serialized as JSON (could be omitted if that was the input) - in addition, a formatted version of the DataValue can be requested as output. * Note that formatting can depend on a lot of factors: data type, desired output format (html?), current language and variant, user settings (e.g. babel, perhaps even preferred unit system), etc.
Being able to easily the #Babel information with an API allows "Reasonator" to apply language fall back.