-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
releasedIssue has been releasedIssue has been released
Description
The current code foe each event loads its schema in this way
sdk-java/sdk/src/main/java/dev/cdevents/events/PipelinerunStartedCDEvent.java
Lines 102 to 108 in 3055c23
| public String eventSchema() { | |
| try { | |
| return Files.readString(Paths.get(CDEventConstants.SCHEMA_FOLDER + "/pipelinerunstarted.json")); | |
| } catch (IOException e) { | |
| throw new CDEventsException("Exception while reading Event JsonSchema file ", e); | |
| } | |
| } |
Which means it expects to find the schema as a file in the filesystem. This code fails when the cdevents-java-sdk is consumed as a dependency by other projects, as the schema files are no longer found in the filesystem but rather as embedded resources within the cdevents-java-sdk JAR.
This code must be updated to find the schema as a classpath resource first, falling back to filesystem if not found.
Metadata
Metadata
Assignees
Labels
releasedIssue has been releasedIssue has been released