Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema for JReleaser #2793

Closed
aalmiray opened this issue Feb 15, 2023 · 4 comments
Closed

Add schema for JReleaser #2793

aalmiray opened this issue Feb 15, 2023 · 4 comments
Labels
new-schema-request Request to add a new JSON schema. (auto-generated by issue forms)

Comments

@aalmiray
Copy link
Contributor

Description of the JSON schema.

JReleaser is a release automation tool. Its goal is to simplify creating releases and publishing artifacts to multiple package managers while providing customizable options.

Supporting information.

Schema for the upcoming 1.5.0 release jreleaser-1.5.0-SNAPSHOT-schema.json.txt

Are you making a PR for this?

Yes, I will create a PR.

@aalmiray aalmiray added the new-schema-request Request to add a new JSON schema. (auto-generated by issue forms) label Feb 15, 2023
@aalmiray
Copy link
Contributor Author

Before submitting a PR I've to ask for additional information regarding validation during tests. I'm getting the following error

################ Error message
>> compile              | schemas/json/jreleaser-1.5.0.json (draft-07)(FullStrictMode)
>> Error: strict mode: missing type "object" for keyword "additionalProperties" at "#/properties/headers/allOf/1" (strictTypes)
##############################

The headers property is defined as follows:

        "headers" : {
          "allOf" : [ {
            "$ref" : "#/definitions/StringProperties"
          }, {
            "additionalProperties" : {
              "type" : "string"
            }
          } ]
        },

StringProperties is defined as:

    "StringProperties" : {
      "type" : "object",
      "additionalProperties" : {
        "type" : "string"
      }
    },

The schema is automatically generated using https://github.com/victools/jsonschema-generator and its Jackson module. Would love to get some help in configuring the schema generator so that the generated schema complies with tests. TIA.

@hyperupcall
Copy link
Member

hyperupcall commented Mar 25, 2023

@aalmiray additionalProperties conceptually implies that the type is an object. But in strict mode, it requires you to explicitly say the type is an object in every case.

Before:

{
  "additionalProperties": {
    "type": "string"
  }
}

After fix:

{
  "type": "object",
  "additionalProperties": {
    "type": "string"
  }
}

This fix is only present in the first item specified in the "allOf", but not the second one.

@aalmiray
Copy link
Contributor Author

Thank you for the tip. I've manually made adjustments to the schema file and have successfully ran all tests. Now it's the matter of adjusting the automatic schema generator. Will come back when ready.

aalmiray added a commit to aalmiray/schemastore that referenced this issue Apr 29, 2023
madskristensen pushed a commit that referenced this issue May 1, 2023
* Add schema for JReleaser configuration files (#2793)

Signed-off-by: Andres Almiray <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Andres Almiray <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@aalmiray
Copy link
Contributor Author

aalmiray commented May 1, 2023

PR #2939 has been merged. This can be closed.

@aalmiray aalmiray closed this as completed May 1, 2023
jmatias pushed a commit to jmatias/schemastore that referenced this issue Jul 19, 2023
…maStore#2939)

* Add schema for JReleaser configuration files (SchemaStore#2793)

Signed-off-by: Andres Almiray <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Andres Almiray <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-schema-request Request to add a new JSON schema. (auto-generated by issue forms)
Projects
None yet
Development

No branches or pull requests

2 participants