Skip to content

Commit

Permalink
chore: schema bump 7.0.0 license refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Avi Deitcher <avi@deitcher.net>
  • Loading branch information
spiffcs authored and deitch committed Feb 8, 2023
1 parent 01beb7b commit 1f3e5c0
Show file tree
Hide file tree
Showing 29 changed files with 1,774 additions and 199 deletions.
2 changes: 1 addition & 1 deletion internal/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ const (

// JSONSchemaVersion is the current schema version output by the JSON encoder
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment.
JSONSchemaVersion = "6.2.0"
JSONSchemaVersion = "7.0.0"
)
14 changes: 14 additions & 0 deletions internal/logicalstrings.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ func (l LogicalStrings) String() string {
return strings.Join(parts, fmt.Sprintf(" %s ", joiner))
}

func (l LogicalStrings) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, l.String())), nil
}

func (l *LogicalStrings) UnmarshalJSON(data []byte) error {
raw := strings.Trim(string(data), `"`)
ls, err := ParseLogicalStrings(raw)
if err != nil {
return err
}
*l = ls
return nil
}

// Process processes each simple element inside the LogicalStrings through a provided function,
// returning a new LogicalStrings with the fields replaced.
func (l LogicalStrings) Process(f func(string) string) LogicalStrings {
Expand Down
Loading

0 comments on commit 1f3e5c0

Please # to comment.