Skip to content

Conversation

@czechboy0
Copy link
Contributor

Motivation

Previously, when the generation logic threw an error, we wouldn't finalize the diagnostics collector, which in the case of the YAML file diagnostics collector meant the file would never be written, and the caller wouldn't know why the tool returned a non-0 exit code.

Modifications

Move the finalization into every logic branch, to make sure it's always called at the end.

Result

Now when providing --diagnostics-output-path to the CLI and the generation fails with an error, the diagnostics YAML file will be written correctly.

Test Plan

Tested manually locally using another script that drives swift-openapi-generator.

@czechboy0 czechboy0 merged commit 8f64727 into apple:main Aug 10, 2023
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

2 participants