-
Sometimes specs aren't properly written and e.g. parameters:
- in: query
name: foo
schema:
type: array
description: foos transforms to Is there already a way to achieve this or should I open an issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah that’s a good suggestion! I would support adding this as a flag, perhaps. This is an opinionated take—we get requests from so many people both asking openapi-typescript to be more flexible in generated types, and people like yourself that request more strictness. We generally try and err on the side of strictness, but For things like this, I can’t recommend Redocly’s linting API enough—it can improve quality and consistency of OpenAPI schemas far better than openapi-typescript can. Agree that often people can find ways to improve their schemas when the generated types turn out to be different than expected, but linting is a way to shorten the feedback loop and catch other issues as well. |
Beta Was this translation helpful? Give feedback.
Yeah that’s a good suggestion! I would support adding this as a flag, perhaps. This is an opinionated take—we get requests from so many people both asking openapi-typescript to be more flexible in generated types, and people like yourself that request more strictness. We generally try and err on the side of strictness, but
never[]
may be a little too restrictive for some folks as default behavior.For things like this, I can’t recommend Redocly’s linting API enough—it can improve quality and consistency of OpenAPI schemas far better than openapi-typescript can. Agree that often people can find ways to improve their schemas when the generated types turn out to be different than expected, b…