DGCBarcodeDecoder fails to decode a valid 1.0.0 test result
DGCBarcodeDecoder fails to decode a valid test result which is created using "1.0.0" schema. In particular, field "dr" (Date/Time of Test Result) was valid, but optional field in schema "1.0.0", it is removed in schema "1.3.0". As a result, the decoder now fails. Would it be possible/feasible to support older schemas in addition to "1.3.0"?
Exception se.digg.dgc.payload.v1.DGCSchemaException: Failed to decode DCC from CBOR encoding at se.digg.dgc.payload.v1.DigitalCovidCertificate.decode(DigitalCovidCertificate.java:258) ~[dgc-schema-1.0.1.jar:na] at se.digg.dgc.service.impl.DefaultDGCDecoder.decode(DefaultDGCDecoder.java:71) ~[dgc-create-validate-1.0.1.jar:na]
UnrecognizedPropertyException: Unrecognized field "dr" (class se.digg.dgc.payload.v1.TestEntry), not marked as ignorable (10 known properties: "tt", "tg", "ma", "ci", "is", "co", "tr", "nm", "sc", "tc"])"
Test data https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/BG/2DCode/raw/5.json
Schemas 1.0.0: https://github.com/ehn-dcc-development/ehn-dcc-schema/blob/release/1.0.0/DGC.combined-schema.json 1.3.0 (dr is missing): https://github.com/ehn-dcc-development/ehn-dcc-schema/blob/release/1.3.0/DCC.combined-schema.json
We'll try to add some sort of "ignore" flag for attributes that have been removed from older versions.
Hi Martin,
Would configuring CBOR mapper inside DigitalCovidCertificate to cborMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); do the trick in this case?