IMPORTANT: Before submitting, please remove all sensitive data, secrets, tokens, or confidential information. Ensure you've redacted any NDA-covered information, IP addresses, resource names, or security-related details that shouldn't be publicly disclosed.
Problem Statement
v8r (JSON/YAML schema validator) is not currently enabled in MegaLinter and has no configuration file. This means:
- YAML/JSON files are not validated against their schemas
- No custom schema mappings for project-specific files
- No ignore patterns for files without schemas (false positives)
- Direct tool usage requires manual configuration
Proposed Solution
Create .v8rrc.yml configuration file at repository root:
---
catalogs:
- https://www.schemastore.org/api/json/catalog.json
customCatalog:
schemas:
- name: Docker Compose
fileMatch:
- "**/docker-compose.yml"
- "**/docker-compose.yaml"
- "**/compose.yml"
- "**/compose.yaml"
url: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
- name: MegaLinter
fileMatch:
- ".mega-linter.yml"
- ".mega-linter.yaml"
url: https://raw.githubusercontent.com/oxsecurity/megalinter/main/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json
ignoreUnknownFiles: true
Create .v8rignore file:
**/schemas/**
**/*schema*.json
learning/**/*.yaml
learning/**/*.yml
.copilot-tracking/**
**/*.tfvars
node_modules/**
.terraform/**
**/testdata/**
package-lock.json
**/*.bicepparam
dist/**
build/**
Enable v8r in MegaLinter by adding to .mega-linter.yml:
ENABLE_LINTERS:
# Quality
- SPELL_CSPELL
- YAML_YAMLLINT
- YAML_V8R # Add this
# v8r schema validation configuration
YAML_V8R_CONFIG_FILE: .v8rrc.yml
Alternative Solutions
- Use only yamllint (no schema validation)
- Rely on IDE schema validation only (not enforced in CI)
Target Components
Implementation Ideas
- Create
.v8rrc.yml at repository root
- Create
.v8rignore at repository root
- Add
YAML_V8R to ENABLE_LINTERS in .mega-linter.yml
- Add
YAML_V8R_CONFIG_FILE: .v8rrc.yml to .mega-linter.yml
- Run
npx v8r to validate files against schemas
- Address any schema validation errors found
Additional Context
| Setting |
Value |
Rationale |
| catalogs |
SchemaStore |
Standard schema catalog |
| ignoreUnknownFiles |
true |
Prevent errors for files without schemas |
| customCatalog |
Docker Compose, MegaLinter |
Project-specific schema mappings |
Files excluded via .v8rignore:
- Schema definition files (would cause circular validation)
- Learning/training content (may have intentional schema deviations)
- Generated files (terraform lock, package-lock)
- Bicep parameter files (not JSON schema validated)
Benefits
- Validates YAML/JSON files against their schemas in CI
- Catches schema violations before runtime
- Custom schema mappings for project files
- Enables direct v8r usage outside MegaLinter
Potential Challenges
- May discover existing schema violations in YAML files
- Custom schemas may need periodic updates
- Some files may need to be added to ignore list
Problem Statement
v8r (JSON/YAML schema validator) is not currently enabled in MegaLinter and has no configuration file. This means:
Proposed Solution
Create
.v8rrc.ymlconfiguration file at repository root:Create
.v8rignorefile:Enable v8r in MegaLinter by adding to
.mega-linter.yml:Alternative Solutions
Target Components
Implementation Ideas
.v8rrc.ymlat repository root.v8rignoreat repository rootYAML_V8RtoENABLE_LINTERSin.mega-linter.ymlYAML_V8R_CONFIG_FILE: .v8rrc.ymlto.mega-linter.ymlnpx v8rto validate files against schemasAdditional Context
Files excluded via
.v8rignore:Benefits
Potential Challenges