diff --git a/src/benelog_client/events/document.py b/src/benelog_client/events/document.py index 9df586f..2ea4581 100644 --- a/src/benelog_client/events/document.py +++ b/src/benelog_client/events/document.py @@ -56,7 +56,13 @@ ID_GS1_ORG = "https://id.gs1.org" #: JSON-LD context of EPCIS 2.0. Belongs on the document, not on the event. -EPCIS_CONTEXT = "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld" +#: +#: The UNVERSIONED URL. GS1 publishes the context at +#: .../standards/epcis/epcis-context.jsonld; .../epcis/2.0.0/... pins a +#: snapshot we do not mean. ``schemaVersion`` next to it stays "2.0" -- that +#: is the property's value, not the context version, and GS1's own published +#: examples carry it that way too. +EPCIS_CONTEXT = "https://ref.gs1.org/standards/epcis/epcis-context.jsonld" #: UUIDv5 namespace for the sender-side idempotency keys this library derives #: (see :func:`idempotency_key`). Private and arbitrary, as RFC 4122 intends: diff --git a/tests/test_events.py b/tests/test_events.py index 92b66d2..ec69a59 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -140,9 +140,7 @@ def test_a_pallet_holds_its_children(self) -> None: class TestDocument: def test_the_context_sits_on_the_document_not_the_event(self) -> None: wrapped = document([object_event(action=cbv.OBSERVE, event_time=NOON)]) - assert wrapped["@context"] == [ - "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld" - ] + assert wrapped["@context"] == ["https://ref.gs1.org/standards/epcis/epcis-context.jsonld"] assert "@context" not in wrapped["epcisBody"]["eventList"][0] @@ -411,7 +409,7 @@ def test_a_prefix_from_an_earlier_document_does_not_leak_into_the_next(self) -> # canonicalises — weeks later, in production only. with_prefix = { "@context": [ - "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld", + "https://ref.gs1.org/standards/epcis/epcis-context.jsonld", {"ex": "https://one.example.test/ns/"}, ], "type": "EPCISDocument",