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

JSON schema aggregation should use unevaluatedProperties in global properties #89

Closed
fstaudt opened this issue May 7, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@fstaudt
Copy link
Owner

fstaudt commented May 7, 2023

JSON schema aggregated-values.schema.json is currently generated with .properties.global.additionalProperties set to false:

{
  "properties": {
    "global": {
      "additionalProperties": false,
      "allOf": [
        {
          "$ref": "..."
        },
        {
          "$ref": "..."
        },
        {
          "title": "Aggregated global values for chart",
        }
      ]
    }
  }
}

According to JSON schemas specification, unevaluatedProperties should be used instead to ensure correct validation after schema composition:

{
  "properties": {
    "global": {
      "unevaluatedProperties": false,
      "allOf": [
        {
          "$ref": "..."
        },
        {
          "$ref": "..."
        },
        {
          "title": "Aggregated global values for chart",
        }
      ]
    }
  }
}

Flag additionalProperties should also be removed from sub-schemas in aggregated JSON schema when schemas are composed with allOf.

Current usage of additionalProperties cause incorrect validation errors in VS code and in gradle task validateHelmValues implemented with https://github.com/networknt/json-schema-validator.

@fstaudt fstaudt added the bug Something isn't working label May 7, 2023
@fstaudt fstaudt added this to the 0.7.0 milestone May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant