mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
update json schema and test for java virtualPath
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
76c8f24090
commit
8bcba7d830
@ -376,9 +376,6 @@
|
|||||||
},
|
},
|
||||||
"pomProperties": {
|
"pomProperties": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"Path": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"artifactId": {
|
"artifactId": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -391,25 +388,32 @@
|
|||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"Path",
|
|
||||||
"artifactId",
|
"artifactId",
|
||||||
"extraFields",
|
"extraFields",
|
||||||
"groupId",
|
"groupId",
|
||||||
"name",
|
"name",
|
||||||
|
"path",
|
||||||
"version"
|
"version"
|
||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
},
|
||||||
|
"virtualPath": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"manifest",
|
"manifest",
|
||||||
"parentPackage",
|
"parentPackage",
|
||||||
"pomProperties"
|
"pomProperties",
|
||||||
|
"virtualPath"
|
||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
@ -446,9 +450,6 @@
|
|||||||
},
|
},
|
||||||
"pomProperties": {
|
"pomProperties": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"Path": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"artifactId": {
|
"artifactId": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -461,16 +462,19 @@
|
|||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"Path",
|
|
||||||
"artifactId",
|
"artifactId",
|
||||||
"extraFields",
|
"extraFields",
|
||||||
"groupId",
|
"groupId",
|
||||||
"name",
|
"name",
|
||||||
|
"path",
|
||||||
"version"
|
"version"
|
||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
@ -510,6 +514,9 @@
|
|||||||
},
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"virtualPath": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
|
|||||||
@ -143,6 +143,7 @@ func TestParseJar(t *testing.T) {
|
|||||||
Type: pkg.JenkinsPluginPkg,
|
Type: pkg.JenkinsPluginPkg,
|
||||||
MetadataType: pkg.JavaMetadataType,
|
MetadataType: pkg.JavaMetadataType,
|
||||||
Metadata: pkg.JavaMetadata{
|
Metadata: pkg.JavaMetadata{
|
||||||
|
VirtualPath: "test-fixtures/java-builds/packages/example-jenkins-plugin.hpi",
|
||||||
Manifest: &pkg.JavaManifest{
|
Manifest: &pkg.JavaManifest{
|
||||||
ManifestVersion: "1.0",
|
ManifestVersion: "1.0",
|
||||||
SpecTitle: "The Jenkins Plugins Parent POM Project",
|
SpecTitle: "The Jenkins Plugins Parent POM Project",
|
||||||
@ -188,6 +189,7 @@ func TestParseJar(t *testing.T) {
|
|||||||
Type: pkg.JavaPkg,
|
Type: pkg.JavaPkg,
|
||||||
MetadataType: pkg.JavaMetadataType,
|
MetadataType: pkg.JavaMetadataType,
|
||||||
Metadata: pkg.JavaMetadata{
|
Metadata: pkg.JavaMetadata{
|
||||||
|
VirtualPath: "test-fixtures/java-builds/packages/example-java-app-gradle-0.1.0.jar",
|
||||||
Manifest: &pkg.JavaManifest{
|
Manifest: &pkg.JavaManifest{
|
||||||
ManifestVersion: "1.0",
|
ManifestVersion: "1.0",
|
||||||
},
|
},
|
||||||
@ -208,6 +210,7 @@ func TestParseJar(t *testing.T) {
|
|||||||
Type: pkg.JavaPkg,
|
Type: pkg.JavaPkg,
|
||||||
MetadataType: pkg.JavaMetadataType,
|
MetadataType: pkg.JavaMetadataType,
|
||||||
Metadata: pkg.JavaMetadata{
|
Metadata: pkg.JavaMetadata{
|
||||||
|
VirtualPath: "test-fixtures/java-builds/packages/example-java-app-maven-0.1.0.jar",
|
||||||
Manifest: &pkg.JavaManifest{
|
Manifest: &pkg.JavaManifest{
|
||||||
ManifestVersion: "1.0",
|
ManifestVersion: "1.0",
|
||||||
Extra: map[string]string{
|
Extra: map[string]string{
|
||||||
@ -233,6 +236,7 @@ func TestParseJar(t *testing.T) {
|
|||||||
Type: pkg.JavaPkg,
|
Type: pkg.JavaPkg,
|
||||||
MetadataType: pkg.JavaMetadataType,
|
MetadataType: pkg.JavaMetadataType,
|
||||||
Metadata: pkg.JavaMetadata{
|
Metadata: pkg.JavaMetadata{
|
||||||
|
VirtualPath: "test-fixtures/java-builds/packages/example-java-app-maven-0.1.0.jar",
|
||||||
PomProperties: &pkg.PomProperties{
|
PomProperties: &pkg.PomProperties{
|
||||||
Path: "META-INF/maven/joda-time/joda-time/pom.properties",
|
Path: "META-INF/maven/joda-time/joda-time/pom.properties",
|
||||||
GroupID: "joda-time",
|
GroupID: "joda-time",
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import "github.com/package-url/packageurl-go"
|
|||||||
|
|
||||||
// JavaMetadata encapsulates all Java ecosystem metadata for a package as well as an (optional) parent relationship.
|
// JavaMetadata encapsulates all Java ecosystem metadata for a package as well as an (optional) parent relationship.
|
||||||
type JavaMetadata struct {
|
type JavaMetadata struct {
|
||||||
VirtualPath string `json:"virtual-path"`
|
VirtualPath string `json:"virtualPath"`
|
||||||
Manifest *JavaManifest `mapstructure:"Manifest" json:"manifest"`
|
Manifest *JavaManifest `mapstructure:"Manifest" json:"manifest"`
|
||||||
PomProperties *PomProperties `mapstructure:"PomProperties" json:"pomProperties"`
|
PomProperties *PomProperties `mapstructure:"PomProperties" json:"pomProperties"`
|
||||||
Parent *Package `json:"parentPackage"` // TODO: should this be included in the json output?
|
Parent *Package `json:"parentPackage"` // TODO: should this be included in the json output?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user