Skip to content

Commit 6cf0cf2

Browse files
committed
update
1 parent 4962e6a commit 6cf0cf2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/cli/internal/cli/split/split.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (o *Opts) saveVersionedOas(oas *openapi3.T, version string) error {
9191
}
9292

9393
path = strings.Replace(path, "."+o.format, fmt.Sprintf("-%s.%s", version, o.format), 1)
94-
return openapi.SaveToFile(path, o.format, oas, o.fs)
94+
return openapi.Save(path, oas, o.format, o.fs)
9595
}
9696

9797
func (o *Opts) PreRunE(_ []string) error {

tools/cli/internal/openapi/file.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ func SerializeToYAML(data []byte) ([]byte, error) {
118118
return yamlData, nil
119119
}
120120

121+
// Save saves the OpenAPI document to a file in the specified format. This is important for public
122+
// OpenAPI documents as it ensures to follow the order of the Spec object.
121123
func Save(path string, oas *openapi3.T, format string, fs afero.Fs) error {
122124
return SaveToFile(path, format, newSpec(oas), fs)
123125
}

0 commit comments

Comments
 (0)