Skip to content

Commit

Permalink
revert unneeded rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Reuven committed Oct 8, 2023
1 parent 557e2de commit b657344
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Spec can be a path to a file, a URL or '-' to read standard input.
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {

flags.source = load.GetSource(args[0])
flags.spec = load.GetSource(args[0])

// by now flags have been parsed successfully so we don't need to show usage on any errors
cmd.Root().SilenceUsage = true
Expand All @@ -49,17 +49,17 @@ func runFlatten(flags *FlattenFlags, stdout io.Writer) *ReturnError {

loader := openapi3.NewLoader()
loader.IsExternalRefsAllowed = true
spec, err := load.LoadSpecInfo(loader, flags.source)
spec, err := load.LoadSpecInfo(loader, flags.spec)
if err != nil {
return getErrFailedToLoadSpec("original", flags.source, err)
return getErrFailedToLoadSpec("original", flags.spec, err)
}

// TODO: get the original format of the spec
format := flags.format

flatSpec, err := flatten.MergeSpec(spec.Spec)
if err != nil {
return getErrFailedToFlattenSpec("original", flags.source, err)
return getErrFailedToFlattenSpec("original", flags.spec, err)
}

if returnErr := outputFlattenedSpec(format, stdout, flatSpec); returnErr != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/flatten_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package internal
import "github.com/tufin/oasdiff/load"

type FlattenFlags struct {
source load.Source
spec load.Source
format string
circularReferenceCounter int
}

0 comments on commit b657344

Please sign in to comment.