Redocly / Redocly/redocly-cli

Ajv reports an error on Windows with two references to the same common schema

Open
#796 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c1 p3 Type: Bug
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Describe the bug
Ajv reports an error on Windows with two references to the same common schema even though this use case is valid against OpenAPI (see screenshot below). Weren't able to reproduce this on macOS though.

To Reproduce
Steps to reproduce the behavior:

  1. Given these files:
    redocly-lint (updated).zip
  2. Run lint command on Windows.
  3. See error.

image

Expected behavior
The schema seems to valid so there no errors should be found.

Logs
N/a

OpenAPI definition
Shared above.

Redocly Version(s)
1.0.0-beta.105

Node.js Version(s)
14+

Additional context
N/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached redocly-lint archive and reproduce the failure by running the lint command on Windows with Redocly CLI 1.0.0-beta.105 and Node.js 14+. Trace the Ajv validation path for the two references to the same common schema; done means the valid OpenAPI definition lints without this Windows-only error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, openapi, typescript
Domain
backend-api-design, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.