Skip to content

Commit af2788d

Browse files
authored
Unified Language for json outputs in get and verify commands (#108)
1 parent 665880a commit af2788d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

evidence/get/get_base.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,26 @@ type EvidenceEntry struct {
4545
}
4646

4747
type CustomEvidenceResult struct {
48-
RepoPath string `json:"repoPath"`
48+
RepoPath string `json:"subjectRepoPath"`
4949
Evidence []EvidenceEntry `json:"evidence"`
5050
}
5151

5252
type ArtifactEvidence struct {
5353
Evidence EvidenceEntry `json:"evidence"`
54-
PackageType string `json:"package-type"`
55-
RepoPath string `json:"repo-path"`
54+
PackageType string `json:"packageType"`
55+
RepoPath string `json:"subjectRepoPath"`
5656
}
5757

5858
type BuildEvidence struct {
5959
Evidence EvidenceEntry `json:"evidence"`
60-
BuildName string `json:"build-name"`
61-
BuildNumber string `json:"build-number"`
62-
StartedAt string `json:"started-at"`
60+
BuildName string `json:"buildName"`
61+
BuildNumber string `json:"buildNumber"`
62+
StartedAt string `json:"startedAt"`
6363
}
6464

6565
type ReleaseBundleResult struct {
66-
ReleaseBundle string `json:"release-bundle"`
67-
ReleaseBundleVersion string `json:"release-bundle-version"`
66+
ReleaseBundle string `json:"releaseBundle"`
67+
ReleaseBundleVersion string `json:"releaseBundleVersion"`
6868
Evidence []EvidenceEntry `json:"evidence"`
6969
Artifacts []ArtifactEvidence `json:"artifacts,omitempty"`
7070
Builds []BuildEvidence `json:"builds,omitempty"`

evidence/get/get_base_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ func TestExportEvidenceToJsonlFileWithMetadata(t *testing.T) {
137137
case i < 4:
138138
// Next two lines should be artifact type
139139
assert.Equal(t, "artifact", item["type"], "Line %d should be artifact type", i+1)
140-
assert.Contains(t, result, "package-type", "Line %d should contain package-type", i+1)
141-
assert.Contains(t, result, "repo-path", "Line %d should contain repo-path", i+1)
140+
assert.Contains(t, result, "packageType", "Line %d should contain packagType", i+1)
141+
assert.Contains(t, result, "subjectRepoPath", "Line %d should contain subjectRepoPath", i+1)
142142
default:
143143
// Last two lines should be build type
144144
assert.Equal(t, "build", item["type"], "Line %d should be build type", i+1)
145-
assert.Contains(t, result, "build-name", "Line %d should contain build-name", i+1)
146-
assert.Contains(t, result, "build-number", "Line %d should contain build-number", i+1)
147-
assert.Contains(t, result, "started-at", "Line %d should contain started-at", i+1)
145+
assert.Contains(t, result, "buildName", "Line %d should contain buildName", i+1)
146+
assert.Contains(t, result, "buildNumber", "Line %d should contain buildNumber", i+1)
147+
assert.Contains(t, result, "startedAt", "Line %d should contain startedAt", i+1)
148148
}
149149
}
150150
} else {

evidence/testdata/get/multiple_evidence_expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schemaVersion": "1.0",
33
"type": "artifact",
44
"result": {
5-
"repoPath": "dort-generic/test/path/file.txt",
5+
"subjectRepoPath": "dort-generic/test/path/file.txt",
66
"evidence": [
77
{
88
"createdAt": "2025-07-03T18:54:59.108Z",

0 commit comments

Comments
 (0)