Skip to content

Duplicate Schema Bug #345

Closed
Closed
@Fleshgrinder

Description

@Fleshgrinder

I have a YAML file that gets loaded but has no schema associated with it. Whenever I run the plugin without an explicit ignore of that file it fails with:


Oops! Something went wrong! :(

ESLint: 9.9.0

Error: Error while loading rule 'json-schema-validator/no-invalid': schema with key or id "https://github.com/howlowck/common-catalog-schema/schema-versions.json" already exists
Occurred while linting /Users/fleshgrinder/Projects/src/<REDACTED>/.catalog.yml
    at Ajv._checkUnique (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/ajv/dist/core.js:466:19)
    at Ajv.addSchema (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/ajv/dist/core.js:234:14)
    at resolveError (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/utils/validator-factory.js:109:29)
    at schemaToValidator (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/utils/validator-factory.js:64:17)
    at compile (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/utils/validator-factory.js:42:12)
    at schemaPathToValidator (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:27:44)
    at getCatalogValidators (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:319:35)
    at /Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:401:69
    at get (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:389:27)
    at get catalog (/Users/fleshgrinder/Projects/src/<REDACTED>/node_modules/eslint-plugin-json-schema-validator/lib/rules/no-invalid.js:401:28)

The only workaround I found was to switch to flat/base and adding an explicit ignores: ['.catalog.yml'] to my config. Note that there's actually a schema, but #343 and #344 prevent me from validating it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds reproNeed a repository that can reproduce the problem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions