Skip to content

Implement Data Type Extensions #28

Open
@setrofim

Description

@setrofim

CoRIM spec defines two types of extensibility:

  • Map Extensions, indicated by $$NAME-extension, allow extending map structures defined in the spec by adding new data fields. This is already covered by ExtensionMap.
  • Data Type Extensions, indicated by $NAME-type-choice, allow extending structures defined in the spec with additional data types for existing fields. This is currently not supported.

(Note: there is also a third kind, due to CoSWID -- "enum extensions", indicated by $NAME (without the -type-choice suffix), which allows specifying addition values to defined enumerations, such as $role. This, too, is already covered).

To support Data Type Extensions, we will need to

  • Add Extension(ExtensionValue<'a>) variant to the type-choice enums.
  • On deserialisation, whenever we don't recognise the data, populate this variant, instead of raising an error.
  • Add a TaggedValue(u64, ExtensionsValue<'a>) variant to ExtensionValue to support new tagged types (this would be the norm for type-choice extensions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions