Skip to content

Commit e2e11c0

Browse files
committed
Update
1 parent 6cf0cf2 commit e2e11c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/cli/internal/cli/usage/usage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const (
1818
Base = "Base OAS. The command will merge other OASes into it."
1919
External = "OASes that will be merged into the base OAS."
2020
Output = "File name or path where the command will store the output."
21-
Format = "Output format. Supported values are 'json' and 'yaml'."
21+
Format = "Output format. Supported values are 'json', 'yaml' or 'all' which will generate one file for each supported format."
2222
Versions = "Boolean flag that defines wether to split the OAS into multiple versions."
2323
VersionsChangelog = "List of versions to consider when generating the changelog. (Format: YYYY-MM-DD)"
2424
Spec = "Path to the OAS file."

tools/cli/internal/openapi/file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ func SaveToFile[T any](path, format string, content T, fs afero.Fs) error {
4141
return err
4242
}
4343

44-
if format == JSON || format == "" {
44+
if format == JSON || format == "" || format == "all" {
4545
jsonPath := newPathWithExtension(path, JSON)
4646
if errJSON := afero.WriteFile(fs, jsonPath, data, 0o600); errJSON != nil {
4747
return errJSON
4848
}
4949
log.Printf("\nFile was saved in '%s'.\n\n", jsonPath)
5050
}
5151

52-
if format == YAML || format == "" {
52+
if format == YAML || format == "" || format == "all" {
5353
dataYAML, err := SerializeToYAML(data)
5454
if err != nil {
5555
return err

0 commit comments

Comments
 (0)