{"id":42267838,"url":"https://github.com/cvent/spectral-bug-example","last_synced_at":"2026-01-27T06:51:32.572Z","repository":{"id":212726892,"uuid":"731715495","full_name":"cvent/spectral-bug-example","owner":"cvent","description":"Repo that contains a bug linting jsonschema files using spectral when the schema files have a circular reference and the lint command is provided a glob of files.","archived":false,"fork":false,"pushed_at":"2026-01-14T01:09:14.000Z","size":31,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-01-14T04:59:46.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cvent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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":null,"cla":null}},"created_at":"2023-12-14T17:51:51.000Z","updated_at":"2023-12-14T17:51:51.000Z","dependencies_parsed_at":"2025-03-10T21:20:38.119Z","dependency_job_id":"c94c5d2c-725d-47e0-9de3-7fd9ed9dd1af","html_url":"https://github.com/cvent/spectral-bug-example","commit_stats":null,"previous_names":["cvent/spectral-bug-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cvent/spectral-bug-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fspectral-bug-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fspectral-bug-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fspectral-bug-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fspectral-bug-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvent","download_url":"https://codeload.github.com/cvent/spectral-bug-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvent%2Fspectral-bug-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28806722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T06:25:51.065Z","status":"ssl_error","status_checked_at":"2026-01-27T06:25:50.640Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-27T06:51:31.993Z","updated_at":"2026-01-27T06:51:32.544Z","avatar_url":"https://github.com/cvent.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple repo to demonstrate spectral bug\nA Simple repo to show a bug when linting a glob pattern. \n\n## Installation instructions\nEnsure you either have nodejs installed or asdf installed and the nodejs plugin added. If using asdf, run `asdf install`. Then run `npm install`\n\n## Reproducing the bug\nSimple scripts have been added to `package.json` to reproduce the bug. To see the bug, simply run\n```\nnpm run lint\n```\nThis will use spectral to lint all the .json files in this repo. This will cause the following error to be reported\n```\nspectral-bug-example/models/bulk-response.json\n 1:1  error  invalid-ref  ENOENT: no such file or directory, open 'spectral-bug-example/models/error.json' properties.data.oneOf[1].properties.details.items.properties.details.items.properties.details.items.properties.details.items.$ref\n```\nBut if you run any of the three following commands\n```\nnpm run lint-bulk\nnpm run lint-item\nnpm run lint-error\n```\nwhich lints just a single json file at a time, no error is reported.\n\n## Probable reasons for bug\nIf you look at the reported error, it is looking for `error.json` in the `models` folder even though `error.json` is in the `errors` folder. I believe this is happening because while linting `bulk-response-item.json` it fully resolves it, and because `error.json` contains a relative reference to itself, it is preserved, and brought into `bulk-response-item.json`. And when `bulk-response.json` is resolved, it brings in the already resolved `bulk-response-item.json`, including the now incorrect reference to `error.json`. I also noticed this only happens if `bulk-response-item.json` is linted before `bulk-response.json`, if, for example, you change the name of `bulk-item-response.json` to `item.json` and update the references to it, then run the lint command, it will resolve normally. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvent%2Fspectral-bug-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvent%2Fspectral-bug-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvent%2Fspectral-bug-example/lists"}