aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/vector.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/vector.go')
-rw-r--r--internal/feed/vector.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/feed/vector.go b/internal/feed/vector.go
index a326c85..9e75de7 100644
--- a/internal/feed/vector.go
+++ b/internal/feed/vector.go
@@ -12,7 +12,7 @@ type Vector struct {
Vector cvss.Vector
}
-// Unmarshal CVSS score from JSON.
+// Unmarshal CVSS vector from JSON.
func (me *Vector) UnmarshalJSON(b []byte) error {
// decode string, check for error
var s string
@@ -32,3 +32,8 @@ func (me *Vector) UnmarshalJSON(b []byte) error {
// return success
return nil
}
+
+// Marshal CVSS vector to JSON.
+func (me Vector) MarshalJSON() ([]byte, error) {
+ return json.Marshal(me.Vector.String())
+}