Open markedwards opened 5 months ago
It's easy to get a rudimentary variant of this functionality running using the API. I would be willing to assist with this feature, but I don't know all of the complexity involved in rolling it in to the CLI at this point.
If this is as straightforward as it seems to me, after doing my own implementation, then I'm happy to do a PR for it. As I envision it, the --validate
flag would require either:
redocly.yaml
(in which case all defined apis will be validated and any failure would throw an error)--output
flag to be specifiedI’d love a PR for this! @markedwards I agree with your take on this.
Thanks @drwpow, I'll open one when I get a chance.
I notice that there is a new --check
flag in the latest release, which I guess is supposed to do what I describe above? However, it does not appear to work for me. If I do openapi-typescript --check
it passes regardless of whether there is even a file in the output location.
Does this feature not work with the redocly.yaml
file?
This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
Pinging on this. Should I open a separate issue for the --check
feature apparently not working?
Description
There's no apparent way to validate that the existing generated types in the target file match the current schema. This is useful in a CI pipeline.
Proposal
A validation mode triggered by a
--validate
should do the trick. This would change the behavior from updating the file at the output path, to validating that its contents match the output that would be generated from the current schema. If the file doesn't exist, or if there is any difference, an error should be emitted.Checklist