kdl icon indicating copy to clipboard operation
kdl copied to clipboard

KDL Schema: clarify definition of "format"

Open nichtich opened this issue 2 years ago • 1 comments

KDL Schema Specification includes format for string and number validation to control the "Intended data format" but KDL does not know the concept of data formats. What should a validator check with format?

  • the tag/type of a value (this is already covered by tag, isn't it?)
  • for strings the pattern (so ISO8601 and several other specifications are mandatory references to the spec)
  • for numbers the serialization (this is not required to be preserved)
  • the internal representation of a value (this should out of the scope of KDL Schema)

nichtich avatar Oct 12 '21 08:10 nichtich

While internal representation is likely out of scope and probably should remain so, the same can't be said of the effects. Underflow in single precision floats was recently cited as argument that KDL would be better with a stronger opinion on numeric formats

The argument is that there exists a number, N, that can be safely represented in a 32 bit float, for which there is a value N+1 that could be correctly parsed and stored as a 64 bit float, but would render as N if stored as a 32 bit float. As long as we're talking about a tractable number of such cases, like overflow and underflow errors possible with the formats listed in the schema document, I'm prepared to identify N and write test cases for attempting to roundtrip N+1, though I'll have some questions in the process

swift2plunder avatar Oct 23 '21 22:10 swift2plunder