Skip to content

Existing output file should be deleted/overwritten#2886

Merged
martincostello merged 3 commits intodomaindrivendev:masterfrom
patrikwlund:overwrite-file
May 15, 2024
Merged

Existing output file should be deleted/overwritten#2886
martincostello merged 3 commits intodomaindrivendev:masterfrom
patrikwlund:overwrite-file

Conversation

@patrikwlund
Copy link
Contributor

The CLI currently uses File.OpenWrite(path) (added in #2677) to create an output stream for the resulting swagger document. This does not delete the existing contents, but instead starts writing from position 0, causing issues if the output is smaller than the previous file content.

I changed it to File.Create(path) to make sure any previous content is discarded.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openapi.yml file being generated with corrupted values

3 participants