update json schema to v2

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman 2021-11-17 13:41:50 -05:00
parent f8a874a3de
commit 81c956cdbd
No known key found for this signature in database
GPG Key ID: 5CB45AE22BAB7EA7
3 changed files with 1005 additions and 3 deletions

View File

@ -6,5 +6,5 @@ const (
// JSONSchemaVersion is the current schema version output by the JSON presenter // JSONSchemaVersion is the current schema version output by the JSON presenter
// This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment. // 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 = "1.1.0" JSONSchemaVersion = "2.0.0"
) )

View File

@ -12,7 +12,7 @@ import (
"github.com/alecthomas/jsonschema" "github.com/alecthomas/jsonschema"
"github.com/anchore/syft/internal" "github.com/anchore/syft/internal"
"github.com/anchore/syft/internal/presenter/poweruser" syftjsonModel "github.com/anchore/syft/internal/formats/syftjson/model"
"github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg"
) )
@ -48,7 +48,7 @@ func build() *jsonschema.Schema {
return strings.TrimPrefix(r.Name(), "JSON") return strings.TrimPrefix(r.Name(), "JSON")
}, },
} }
documentSchema := reflector.ReflectFromType(reflect.TypeOf(&poweruser.JSONDocument{})) documentSchema := reflector.ReflectFromType(reflect.TypeOf(&syftjsonModel.Document{}))
metadataSchema := reflector.ReflectFromType(reflect.TypeOf(&artifactMetadataContainer{})) metadataSchema := reflector.ReflectFromType(reflect.TypeOf(&artifactMetadataContainer{}))
// TODO: inject source definitions // TODO: inject source definitions

File diff suppressed because it is too large Load Diff