{"id":18451786,"url":"https://github.com/giantswarm/schemalint","last_synced_at":"2025-12-15T09:44:37.042Z","repository":{"id":64260015,"uuid":"574487157","full_name":"giantswarm/schemalint","owner":"giantswarm","description":"A JSON schema linter built for some specific purposes at Giant Swarm","archived":false,"fork":false,"pushed_at":"2025-12-12T11:52:28.000Z","size":495,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-13T21:29:38.821Z","etag":null,"topics":["json-schema","linter","normalization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giantswarm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":"DCO","cla":null}},"created_at":"2022-12-05T12:26:03.000Z","updated_at":"2025-12-12T11:52:32.000Z","dependencies_parsed_at":"2024-02-23T21:30:07.273Z","dependency_job_id":"4c2daef2-2dd1-4a74-8df7-cd44b0e0e9d2","html_url":"https://github.com/giantswarm/schemalint","commit_stats":{"total_commits":69,"total_committers":5,"mean_commits":13.8,"dds":0.5652173913043479,"last_synced_commit":"c90fd0f340d054b160638a9a9f0f759630dce7c4"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/giantswarm/schemalint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fschemalint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fschemalint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fschemalint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fschemalint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giantswarm","download_url":"https://codeload.github.com/giantswarm/schemalint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fschemalint/sbom","scorecard":{"id":273,"data":{"date":"2025-08-14T10:22:50Z","repo":{"name":"github.com/giantswarm/schemalint","commit":"d7e5b94114a3a6e20264d49c90c44ef07fabe3c6"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":6.9,"checks":[{"name":"Maintained","score":10,"reason":"19 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Code-Review","score":8,"reason":"Found 5/6 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: RenovateBot: renovate.json5:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:  19 out of  19 GitHub-owned GitHubAction dependencies pinned","Info:  10 out of  10 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/update_action.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.add-team-labels.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.add-to-project-board.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.create_release.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.create_release_pr.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.ensure_major_version_tags.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.fix_vulnerabilities.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.gitleaks.yaml:1","Warn: no topLevel permission defined: .github/workflows/zz_generated.run_ossf_scorecard.yaml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/zz_generated.validate_changelog.yaml:16","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.6.1 not signed: https://api.github.com/repos/giantswarm/schemalint/releases/196066448","Warn: release artifact v2.6.0 not signed: https://api.github.com/repos/giantswarm/schemalint/releases/158587205","Warn: release artifact v2.5.1 not signed: https://api.github.com/repos/giantswarm/schemalint/releases/134483416","Warn: release artifact v2.5.0 not signed: https://api.github.com/repos/giantswarm/schemalint/releases/134102738","Warn: release artifact v2.4.0 not signed: https://api.github.com/repos/giantswarm/schemalint/releases/131372697","Warn: release artifact v2.6.1 does not have provenance: https://api.github.com/repos/giantswarm/schemalint/releases/196066448","Warn: release artifact v2.6.0 does not have provenance: https://api.github.com/repos/giantswarm/schemalint/releases/158587205","Warn: release artifact v2.5.1 does not have provenance: https://api.github.com/repos/giantswarm/schemalint/releases/134483416","Warn: release artifact v2.5.0 does not have provenance: https://api.github.com/repos/giantswarm/schemalint/releases/134102738","Warn: release artifact v2.4.0 does not have provenance: https://api.github.com/repos/giantswarm/schemalint/releases/131372697"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"Contributors","score":10,"reason":"project has 5 contributing companies or organizations","details":["Info: found contributions from: KoelnAPI, aleph alpha, giant swarm, giantswarm, netzbegruenung"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"name":"CI-Tests","score":10,"reason":"30 out of 30 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-08-14T12:21:29.499Z","repository_id":64260015,"created_at":"2025-08-14T12:21:29.499Z","updated_at":"2025-08-14T12:21:29.499Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27748770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-15T02:00:09.782Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema","linter","normalization"],"created_at":"2024-11-06T07:29:38.039Z","updated_at":"2025-12-15T09:44:37.004Z","avatar_url":"https://github.com/giantswarm.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# schemalint – the Giant Swarm JSON Schema linter\n\nschemalint helps you write great JSON schema for [app](https://docs.giantswarm.io/platform-overview/app-platform/) configuration.\n\n## Features\n\n- Validate whether your schema is valid JSON schema\n- Normalize JSON schema (indentation, white space, sorting) and check normalization\n- Experimental: deep validation for [cluster app schema requirements](https://github.com/giantswarm/rfc/pull/55)\n\nValidates whether an input is valid JSON schema. Also helps normalizing, and checks for normalization.\n\n## Installation\n\n```nohighlight\ngo install github.com/giantswarm/schemalint/v2@latest\n```\n\n## Usage\n\n### Validation\n\nExecuting `schemalint verify` without any options will check whether a file is valid JSON Schema and whether it is normalized.\n\n```nohighlight\n$ schemalint verify myschema.json\n\nErrors (1)\n\n- schema is not normalized\n\nVerification result\n\n- [SUCCESS] Input is valid JSON Schema.\n- [ERROR] Input is not normalized.\n```\n\nTo validate a **cluster app** schema, apply the `--rule-set cluster-app` option.\n\n```nohighlight\nschemalint verify myschema.json --rule-set cluster-app\n```\n\n**Note:** Cluster app schema validation is experimental and in development. The requirements are in discussion in [this RFC draft](https://github.com/giantswarm/rfc/pull/55).\n\nUse `--help` to learn about more options.\n\n### Normalization\n\nCreate a normalized (white space, sorting) representation of a JSON Schema file. This helps to avoid purely cosmetical changes to a schema.\n\n```nohighlight\nschemalint normalize myschema.json \u003e normalized.json\n```\n\nUse `--help` to learn about more options.\n\n## GitHub Action\n\nAn action to run `schemalint verify` on the `values.schema.json` in app repositories in provided in `actions/verify-helm-schema`.\n\n**Example workflow**:\n\n```yaml\nname: JSON schema validation\non:\n  push: {}\n\njobs:\n  validate:\n    name: Verify values.schema.json with schemalint\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v3\n      - name: Run schemalint\n        id: run-schemalint\n        uses: giantswarm/schemalint/actions/verify-helm-schema@v1\n        with:\n          rule-set: 'cluster-app'\n```\n\nNote that it is possible to define the rule set to be used for the `verify` command with the `with` keyword.\n\n```yaml\nwith:\n  rule-set: 'RULE_SET'\n```\n\nIf the rule set is not specified, no rule set will be used.\n\n## Pre-commit hooks\n\nThis repository provides a [pre-commit hook](https://pre-commit.com/#new-hooks) that can be used to validate and normalize JSON schema files before committing them. See `.pre-commit-hooks.yaml` for more information.\n\n## Major releases\n\nThis repository uses [floating tags](https://github.com/giantswarm/floating-tags-action).\nOther repositories that use schemalint point to major floating tag versions,\nlike `v1`. That means that all minor and patch releases will be automatically\nrolled out to these repositories.\n\nWhen doing a major release the references to schemalint have to be manually\nupdated.\n\n- devctl:\n  - `pkg/gen/input/workflows/internal/file/cluster_app_schema_validation.yaml.template`\n  - `pkg/gen/input/makefile/internal/file/Makefile.gen.cluster_app.mk.template`\n- schema:\n  - `.github/workflows/lint.yaml\n\n## \"Overriding\" Properties and Understanding `PropertyAnnotationsMap`\n\nIn JSON schema it is possible to have multiple definitions for a properties\nwith the same location. This is possible through the use of\n[refs](https://json-schema.org/understanding-json-schema/structuring.html).\nConsider the following example.\n\n```json\n{\n    \"$defs\": {\n        \"foo\": {\n            \"properties\": {\n                \"childProp\": {\n                    \"type\": \"string\",\n                    \"minLength\": 2,\n                    \"title\": \"This title will be overridden\"\n                }\n            },\n            \"type\": \"object\"\n        }\n    },\n    \"properties\": {\n        \"rootProp\": {\n            \"$ref\": \"#/$defs/foo\",\n            \"properties\": {\n                \"childProp\": {\n                    \"type\": \"string\",\n                    \"maxLength\": 4,\n                    \"title\": \"This title will be used\"\n                }\n            },\n            \"type\": \"object\"\n        }\n    },\n    \"type\": \"object\"\n}\n```\n\nHere, the property at the location `.rootProp.childProp` has two different\ndefinitions.\n\nOne is in the original schema:\n\n```json\n{\n  \"type\": \"string\",\n  \"maxLength\": 4,\n  \"title\": \"This title will be used\"\n}\n```\n\nAnd the other one is in the referenced schema:\n\n```json\n{\n  \"type\": \"string\",\n  \"minLength\": 2,\n  \"title\": \"This title will be overridden\"\n}\n```\n\nIn JSON schema specification is no such thing as overriding or merging. The\nkeywords that have actual meaning during validation will be applied\nsequentially (e.g. `minLength`, `maxLength` and `type`).\nIn our example a payload that conforms to the given schema would need to have\na string of length 2,3 or 4 at the location `.rootProp.childProp`.\n\nThe JSON schema specification does not specify how to handle multiple\ndefinitions for annotations like `title`\n([ref](https://json-schema.org/draft/2020-12/json-schema-core.html#name-distinguishing-among-multip)).\nAs we use annotations for our UI, we need a clear convention when handling\nmultiple annotations.\n\nTo specify which annotation to use, we use _reference levels_.\nA reference level describes how often a `$ref` keyword was resolved to get to\nthe current schema.\nThe root schema always has reference level 0. The resolved schema of a `$ref`\nkeyword increments the reference level.\nThe annotation, which belongs to the schema definition with the lowest\nreference level is used for our UI.\n\nIn the above example what we called \"original schema\" has reference level 0 and\nwhat we called \"referenced schema\" has reference level 1.\nTherefore, the displayed title of the `childProp` would be `This title will be used`.\n\nThis logic does not only apply to our UI but also when validating annotations.\nTherefore, an implementation of what annotations to use can be found in\n`propertyannotations.go@BuildPropertyAnnotationsMap`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiantswarm%2Fschemalint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiantswarm%2Fschemalint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiantswarm%2Fschemalint/lists"}