oasis-tcs / openc2-jadn

OASIS OpenC2 TC: Specifing a vocabulary to describe the meaning of structured data, to provide hints for user interfaces working with structured data, and to make assertions about what a valid instance must look like. https://github.com/oasis-tcs/openc2-jadn
Other
4 stars 2 forks source link

Missing format specifications #70

Closed dlemire60 closed 3 weeks ago

dlemire60 commented 6 months ago

There's a gap in the JADN spec. The CBOR serialization rules mention how to handle the format options f16 and f32, but those aren't defined anywhere else in the spec. In particular, they don't appear in 3.2.1.5, Semantic Validation, where other format options are defined.

Per @davaya "That's definitely a bug, and 3.2.1.5 should also include f64, which is the default for that CBOR encoding but may not be for others."

davaya commented 1 month ago

This raises the larger issue of format extensibility. It should be possible to define and use arbitrary formats without having to update the JADN spec. For example, OpenC2 uses Integer serialization directly for date/time values, and JSON formats can be used for IMs where Time is defined to be a string. But the ideal solution is to define time-related formats where the logical value is an integer serialized in JSON as a string, or serialized in XML as one of the XSD-formatted strings.

I don't have a suggested solution. But requiring every format to be listed in 3.2.1.5 is not extensible.

dlemire60 commented 1 month ago

I believe multiple changes are in order to address the original issue:

  1. The [RFC7049] CBOR reference should be updated to RFC 8949, which obsoletes RFC 7049.
  2. The explanation of CBOR type designations at the beginning of Section 4.4 could be expanded for clarity.
  3. Consider presenting the CBOR types (e.g., bstr, bool, float16) in a separate column in both tables for clarity.
  4. The f64 format option should be added to the second table in section 4.4, aligned to CBOR type # 7.26.
  5. The discussion of the second table should provide some guidance as to the default for CBOR serialization of floating point values.
  6. The # 7.xx construct in the second table should linked to section 3.3 of RFC 8949 where this is described.
davaya commented 3 weeks ago

Closed by #79