gs1 / EPCIS

Draft files being shared for EPCIS 2.0 development
Other
20 stars 7 forks source link

JSON Schema :: Inconsistency :: Top level fields for TransformationEvent are closed, but others are open. #354

Open sgpinkus opened 2 years ago

sgpinkus commented 2 years ago

The JSON Schema closes the top level fields that can occur to this (after deref):

        "propertyNames": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "@context",
                "eventTime",
                "recordTime",
                "eventTimeZoneOffset",
                "eventID",
                "errorDeclaration"
              ]
            },
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "string",
              "enum": [
                "eventType",
                "inputEPCList",
                "inputQuantityList",
                "outputEPCList",
                "outputQuantityList",
                "transformationID",
                "bizStep",
                "disposition",
                "persistentDisposition",
                "readPoint",
                "bizLocation",
                "bizTransactionList",
                "sourceList",
                "destinationList",
                "sensorElementList",
                "ilmd"
              ]
            }
          ]
        }

But none of the other type schemas do this. Why is TransformationEvent the special case? Shouldn't this be done for all types or none of them (I would strongly prefer all types were closed in this way)?

mgh128 commented 2 years ago

Hi @sgpinkus - thanks for this feedback. I'm asking @jmcanterafonseca-iota to take a look, since he developed the modular approach to the JSON Schema. I'm not sure why TransformationEvent should be handled differently from other standard event types such as ObjectEvent. From what I've observed so far, it appears to be connected with the use of propertyNames within the schema for TransformationEvent to specify an enumeration, whereas this approach has not been taken for other event types. I'll log this in a public review comment to make sure that we investigate it and ensure consistency, one way or the other.

jmcanterafonseca-iota commented 2 years ago

@sgpinkus @mgh128 yes, this has to be fixed and added to the rest of event types, I've only implemented it on the TransformationEvent

jmcanterafonseca-iota commented 2 years ago

see PR #369

jmcanterafonseca-iota commented 2 years ago

this can be closed