RalphTro / epcis-event-hash-generator

ALGORITHM and SOFTWARE PROTOTYPE to uniquely identify/validate the integrity of any EPCIS event through a common, syntax-agnostic approach based on hashing. Takes an EPCIS Document (formatted in either XML or JSON-LD) and returns the corresponding hash value(s).
MIT License
8 stars 4 forks source link

support for parsing single event in EPCIS JSON document #38

Closed dakbhavesh closed 3 years ago

dakbhavesh commented 3 years ago

Hi @Echsecutor,

As per latest updates in openapi.yml, added support to parse single event contained epcis json document.

dakbhavesh commented 3 years ago

Hi @Echsecutor, Just a friendly reminder, please take a look at this PR and let me know if you have any review comments.

dakbhavesh commented 3 years ago

Hi @RalphTro, This branch can also be merged as it has no impact on any existing feature and it will be a useful feature to support a single EPCIS event in JSON format.

RalphTro commented 3 years ago

Dear @dakbhavesh , Thanks! I just had a look into this and it worked when I run our script via the command line tool for the event you added ("python3 epcis_event_hash_generator/main.py -p tests/examples/epcisDocWithSingleEvent.json")

I noticed the same bug your other PR is about (i.e. that eventID is to be ignored). Will have a look into this soon as well.

eventType=ObjectEventeventTime=2005-04-04T02:33:31.116ZeventTimeZoneOffset=-06:00epcListepc=urn:epc:id:sgtin:0614141.107346.2017epc=urn:epc:id:sgtin:0614141.107346.2018action=OBSERVEbizStep=https://ns.gs1.org/voc/Bizstep-shippingdisposition=https://ns.gs1.org/voc/Disp-in_transitreadPointid=urn:epc:id:sgln:0614141.07346.1234bizTransactionListbizTransaction=http://transaction.acme.com/po/12345678type=https://ns.gs1.org/voc/BTT-poeventID=_:event1

dakbhavesh commented 3 years ago

Dear @RalphTro, I have fixed the trivial issue. Just needed to update the hash and prehash for a single event example. Pushed changed directly to master as it was pretty straightforward.

Echsecutor commented 3 years ago

@dakbhavesh sorry for not looking into this due to time constraints. @RalphTro many thanks for taking over!