Skip to content

Discussion: How to handle extensions #308

@goneall

Description

@goneall

This is a spin-off issue from #302 which discusses 2 issues focused on how to support Extension subclasses.

According to the SPDX AIPackage specification an optional property field is extension. This field is of type Extension.

Extension is an abstract class so it can't be instantiated.

Referencing an Extension in the JSON-LD without parameters passes the Java coded validation but fails the JSON schema validation (see related spdx/spdx-3-model#1017):

"extension" : [
			{
				"type" : "extension_Extension"
			}
		]

Adding a parameter:

"extension" : [
			{
				"type" : "extension_Extension",
				"randomProperty" : "test"
			}
		]

causes the Java parser to fail with Analysis exception processing SPDX file: No property descriptor for field randomProperty.

Adding any additional type will also cause the Java code to fail.

Is there an approach where we can allow Extensions in the Java library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions