Skip to content

Commit ce100b7

Browse files
authored
fix: Update the version URLs (#59)
URL for v2.1.0 goes to the rtm5 URL rather than the final specification. Updated the schemas to add the option to use 210RTM5 or 210Final Signed-off-by: Owen Rumney <[email protected]>
1 parent 788062b commit ce100b7

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

v2/sarif/sarif.go

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ import (
1212
type Version string
1313

1414
// Version210 represents Version210 of Sarif
15-
const Version210 Version = "2.1.0"
15+
const (
16+
Version210 Version = "2.1.0"
17+
Version210RTM5 Version = "2.1.0-rtm.5"
18+
)
1619

1720
var versions = map[Version]string{
18-
Version210: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json",
21+
Version210: "https://json.schemastore.org/sarif-2.1.0.json",
22+
Version210RTM5: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json",
1923
}
2024

2125
// Report is the encapsulating type representing a Sarif Report
@@ -28,17 +32,17 @@ type Report struct {
2832
}
2933

3034
// New Creates a new Report or returns an error
31-
func New(version Version, includeSchema... bool) (*Report, error) {
32-
schema := ""
35+
func New(version Version, includeSchema ...bool) (*Report, error) {
36+
schema := ""
3337

34-
if len(includeSchema) == 0 || includeSchema[0] {
35-
var err error
38+
if len(includeSchema) == 0 || includeSchema[0] {
39+
var err error
3640

37-
schema, err = getVersionSchema(version)
38-
if err != nil {
39-
return nil, err
40-
}
41-
}
41+
schema, err = getVersionSchema(version)
42+
if err != nil {
43+
return nil, err
44+
}
45+
}
4246
return &Report{
4347
Version: string(version),
4448
Schema: schema,

0 commit comments

Comments
 (0)