Skip to content

Commit

Permalink
make the keys in the json output lowercase (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
naortalmor1 authored Jul 4, 2022
1 parent 7d143db commit 1dd9214
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions internal/printer/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ var (
)

type reportResult struct {
ID string
Name string
Descrition string
Remediation string
Result string
Reason string
Url string
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Remediation string `json:"remediation,omitempty"`
Result string `json:"result,omitempty"`
Reason string `json:"reason,omitempty"`
Url string `json:"url,omitempty"`
}

type reportMetadata struct {
Date string
Statistics Statistics
Date string `json:"date"`
Statistics Statistics `json:"statistics"`
}

type reportResults struct {
Metadata reportMetadata
Results []reportResult
Metadata reportMetadata `json:"metadata"`
Results []reportResult `json:"results"`
}

// println prints a string to the current configured output
Expand Down Expand Up @@ -70,7 +70,7 @@ func getPrintFormat(results []checkmodels.CheckRunResult) ([]reportResult, Stati
resultsToDisplay = append(resultsToDisplay, reportResult{
Name: r.Metadata.Title,
ID: r.ID,
Descrition: r.Metadata.Description,
Description: r.Metadata.Description,
Remediation: r.Metadata.Remediation,
Result: string(r.Result.Status),
Reason: r.Result.Details,
Expand Down
8 changes: 4 additions & 4 deletions internal/printer/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
)

type Statistics struct {
Passed int
Failed int
Unknown int
Total int
Passed int `json:"passed,omitempty"`
Failed int `json:"failed,omitempty"`
Unknown int `json:"unknown,omitempty"`
Total int `json:"total,omitempty"`
}

// NewStatistics initializes a new Statistics struct.
Expand Down

0 comments on commit 1dd9214

Please sign in to comment.