Skip to content

Providing --redocly option does nothing if redocly.yaml file exists, and hangs if it doesn't #2190

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

Open
1 of 2 tasks
elliots opened this issue Mar 4, 2025 · 0 comments
Open
1 of 2 tasks
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@elliots
Copy link

elliots commented Mar 4, 2025

openapi-typescript version

7.6.1

Node.js version

22.13.1

OS + version

macOS 15.3

Description

Two, possibly related issues.

First, if there is a redocly.yaml file, the --redocly/-c option is ignored and the redocly.yaml is used regardless

Second, if there is no redocly.yaml file, the --redocly/-c option causes openapi-typescript to hang

Reproduction

Repro for ignoring if redocly.yaml exists...

echo "apis:
  bad:
    root: bad.yml
    x-openapi-ts:
      output: bad.spec.ts" > ./redocly.yaml

echo "apis:
  good:
    root: good.yml
    x-openapi-ts:
      output: good.spec.ts" > ./redocly.good.yaml

DEBUG=* npx openapi-typescript --redocly=redocly.good.yaml

results in:

➜ ./repro.sh 
  openapi-ts:redoc 0ms Loaded Redoc config
/Users/elliot/repos/core/api/node_modules/@redocly/openapi-core/lib/resolve.js:113
            throw new ResolveError(error);
                  ^

ResolveError: ENOENT: no such file or directory '/Users/elliot/repos/core/api/test/bad.yml'

Repro for hanging with custom redocly file

echo "apis:
  only:
    root: only.yml
    x-openapi-ts:
      output: only.spec.ts" > ./redocly.only.yaml

DEBUG=* npx openapi-typescript --redocly=redocly.only.yaml

results in:

➜ ./repro.sh
  openapi-ts:redoc 0ms Loaded Redoc config

(process does not exit)

Expected result

Should use the configured file

Required

  • My OpenAPI schema is valid and passes the Redocly validator (npx @redocly/cli@latest lint)

Extra

@elliots elliots added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

1 participant