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

Duplicate Schema Bug #345

Closed
Fleshgrinder opened this issue Aug 15, 2024 · 2 comments
Closed

Duplicate Schema Bug #345

Fleshgrinder opened this issue Aug 15, 2024 · 2 comments
Labels
bug Something isn't working needs repro Need a repository that can reproduce the problem

Comments

@Fleshgrinder
Copy link

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.

@ota-meshi
Copy link
Owner

Can you share a repository where we can reproduce the issue?
That will help us debug it.

@ota-meshi ota-meshi added bug Something isn't working needs repro Need a repository that can reproduce the problem labels Sep 14, 2024
@Fleshgrinder
Copy link
Author

I made quite some changes to my setup and am not able to reproduce it myself by now. Nor am I able to create a standalone MRE. I'll close this issue for now, and will reopen it in case I stumble over it again. Sorry for the inconvenience, I should have created an MRE right away, my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Need a repository that can reproduce the problem
Projects
None yet
Development

No branches or pull requests

2 participants