Skip to content

.redocly.lint-ignore.yaml file not respected when generating types #2189

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
2 tasks done
riverajo opened this issue Mar 4, 2025 · 3 comments
Open
2 tasks done

.redocly.lint-ignore.yaml file not respected when generating types #2189

riverajo opened this issue Mar 4, 2025 · 3 comments
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@riverajo
Copy link

riverajo commented Mar 4, 2025

openapi-typescript version

7.6.1

Node.js version

v22.12.0

OS + version

Linux

Description

We've recently started to try to improve our API specs. We are using redcoly for linting. It appears that openapi-typescript also lints internally when generating types using redocly. After adding a redocly.yaml and setting the - recommended, type generation is failing. We've created an ignore file per: https://redocly.com/docs/cli/commands/lint, but openapi-typescript does not appears to be respecting the file and lint failures stop type generation. perhaps they need to be filtered out here: https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/src/lib/redoc.ts#L85-L102

My spec technically passes, however you do get a warning

Woohoo! Your API description is valid. 🎉
5 problems are explicitly ignored.

Reproduction

  • Create a simple spec with lint errors, but is valid
  • generate an ignore file using redocly cli
  • attempt to generate types

Expected result

openapi-typescript internal linting would also respect the redocly's .redocly.lint-ignore.yaml

Required

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

Extra

@riverajo riverajo added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Mar 4, 2025
@duncanbeevers
Copy link
Contributor

Are you generating the types using the openapi-typescript CLI, or with the node.js interface?

@riverajo
Copy link
Author

riverajo commented Mar 4, 2025

The cli npx [email protected]

@134130
Copy link

134130 commented Mar 17, 2025

I've tried to open the PR, but it's not as straightforward as it seems.

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

3 participants