openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

CLI option to validate existing file

Open markedwards opened this issue 1 year ago • 8 comments

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

markedwards avatar Jun 28 '24 18:06 markedwards