Skip to content

Schema Validation for GS1 VCs #786

@OR13

Description

@OR13

Picking on GS1 here, but really this applies to any credential with multiple contexts.

Here is the problem:

We need to validate @context before doing JSON-LD processing.

We have to write a separate validation case for each possible expected context value, this causes the verifiers to have to do lots of context schema validation for GS1 specifically, because they ship so many separate context files.

In addition to that, GS1 does not use https://w3id.org/traceability/v1 so we have lost our ability to assert simple things like:

first context is https://www.w3.org/2018/credentials/v2
second context is https://w3id.org/traceability/v1
additional contexts must match this allow list, etc...

instead, best we can do is the following:

first context is https://www.w3.org/2018/credentials/v2
additional contexts from an allow list, which includes https://w3id.org/traceability/v1 and all GS1 contexts known today.

It would be nicer if https://w3id.org/traceability/v1 bundled GS1 contexts... (all of them), so that we could simply do this:

first context is https://www.w3.org/2018/credentials/v2
second context is https://w3id.org/traceability/v1
additional contexts false.

^ this would be safest option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    VC2.0 Upgradepost-1.0This is for issues that are important but should not block 1.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions