JSON schema: allow quantityElement without quantity field (-> optional)
RalphTro opened this issue · comments
Dear @jmcanterafonseca-iota and @mgh128 ,
Thanks for your latest adjustments of the JSON schema! I just tested if standard vocabulary elements such as bizStep is only allowed in bare string notation, and this seems to work nicely.
The only thing which seems to be left is that the JSON schema expects a quantity field in a quantityElement (which is not required as per the 1.2 standard). Only the epcClass field is required in a quantityELement.
For your convenience, I hereby provide an X Event example in which you need to add a quantity field in the inputQuantityList so that it validates. I presume that this behaviour holds true for all kind of quantityELements.
Thanks in advance for adjusting this last (at least according to my test message stack :-)) issue!
Kind regards,
Ralph
{
"@context": [
"https://gs1.github.io/EPCIS/epcis-context.jsonld",
{
"gs1": "https://gs1.org/voc/"
},
{
"example": "https://ns.example.com/epcis/"
}
],
"id": "https://id.example.org/document1",
"type": "EPCISDocument",
"schemaVersion": "2.0",
"creationDate":"2022-02-17T11:30:47.0Z",
"epcisBody": {
"eventList": [
{
"type": "TransformationEvent",
"eventTime": "2020-01-14T00:00:00.000+01:00",
"eventTimeZoneOffset": "+01:00",
"eventID": "urn:uuid:374d95fc-9457-4a51-bd6a-0bba133845a8",
"inputEPCList": [
"urn:epc:id:sgtin:4012345.011111.987"
],
"outputEPCList": [
"urn:epc:id:sgtin:4012345.033333.AGHFG"
],
"inputQuantityList": [
{
"epcClass": "urn:epc:class:lgtin:4012345.022222.87545GHGH",
}
],
"outputQuantityList": [
{
"epcClass": "urn:epc:idpat:sgtin:4012345.044444.*",
"quantity": 452.0,
"uom": "KGM"
}
],
"bizStep": "commissioning",
"readPoint": {"id": "urn:epc:id:sgln:4012345.00000.0"},
"errorDeclaration": {
"declarationTime": "2020-01-15T00:00:00.000+01:00",
"reason": "incorrect_data",
"example:vendorExtension": "Test1"
}
}
]
}
}