Skip to content

Commit

Permalink
[java-source-utils] Add $schema to CGManifest.json (#1035)
Browse files Browse the repository at this point in the history
Context: https://www.jsonschemavalidator.net/
Context: https://github.com/JamieMagee/verify-cgmanifest
Context: https://json.schemastore.org/component-detection-manifest.json
Context: dotnet/android-libraries#608

There is a [JSON Schema][0] for `CGManifest.json`.

Update `tools/java-source-utils/CGManifest.json` so that it conforms
to the JSON schema.  This involves three sets of changes:

  * Add a `$schema` property.

  * Add a `version` property; I can't find any actual documentation
    for this schema, but the [sample manifest][1] uses `"version": 1`,
    so use the same version.

  * "camelCase" all the JSON property names.  From the
    [JamieMagee/verify-cgmanifest README.md][2]:

    > Component Detection will accept object properties in PascalCase,
    > but JSON schema does not have a case-insensitive mode.
    > Camel case is the most common way to write object properties in
    > JSON.

With these changes, `CGManifest.json` reports no errors when using
<https://www.jsonschemavalidator.net>.

Co-authored-by: Jamie Magee <jamie.magee@microsoft.com>

[0]: https://json.schemastore.org/component-detection-manifest.json
[1]: https://github.com/JamieMagee/verify-cgmanifest/blob/2adfb450cd1f2170c3df120036f4a531285167ef/cgmanifest.sample.json
[2]: https://github.com/JamieMagee/verify-cgmanifest/blob/2adfb450cd1f2170c3df120036f4a531285167ef/README.md
  • Loading branch information
JamieMagee authored Sep 6, 2022
1 parent 58de60f commit fcc33ce
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions tools/java-source-utils/CGManifest.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{
"Registrations": [
"$schema": "https://json.schemastore.org/component-detection-manifest.json",
"version": 1,
"registrations": [
{
"Component": {
"Type": "maven",
"Maven": {
"GroupId": "com.github.javaparser",
"ArtifactId": "javaparser-core",
"Version": "3.16.1"
"component": {
"type": "maven",
"maven": {
"groupId": "com.github.javaparser",
"artifactId": "javaparser-core",
"version": "3.16.1"
}
},
"DevelopmentDependency":false
"developmentDependency":false
},
{
"Component": {
"Type": "maven",
"Maven": {
"GroupId": "com.github.javaparser",
"ArtifactId": "javaparser-symbol-solver-core",
"Version": "3.16.1"
"component": {
"type": "maven",
"maven": {
"groupId": "com.github.javaparser",
"artifactId": "javaparser-symbol-solver-core",
"version": "3.16.1"
}
},
"DevelopmentDependency":false
"developmentDependency":false
}
]
}
}

0 comments on commit fcc33ce

Please # to comment.