Skip to content

Commit

Permalink
Addressed issue #132
Browse files Browse the repository at this point in the history
Circular references are no reason to fail running wiretap. Warnings are printed if there are errors, but the model is loaded.
  • Loading branch information
daveshanley committed Aug 8, 2024
1 parent 0d7463d commit f1c4224
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/root_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,17 @@ var (
// build a model
var errs []error
docModel, errs = doc.BuildV3Model()
if len(errs) > 0 {
if len(errs) > 0 && docModel != nil {
pterm.Warning.Printf("OpenAPI Specification loaded, but there %s %d %s detected...\n",
shared.Pluralize(len(errs), "was", "were"),
len(errs),
shared.Pluralize(len(errs), "issue", "issues"))
for _, e := range errs {
pterm.Warning.Printf("--> %s\n", e.Error())
}
}
if len(errs) > 0 && docModel == nil {
pterm.Error.Printf("Failed to load / read OpenAPI specification.")
return errors.Join(errs...)
}
}
Expand Down

0 comments on commit f1c4224

Please # to comment.