A clean sweep around resolving during model builds.

Really hammering on this model using all available examples of crazy references used in crazy ways. The fixes mean I can delete the recent patch added to handle lost indexes.

I spent two days on this commit.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2024-02-19 16:37:33 -05:00
parent a6c5bdaf28
commit 2f82a69d6c
12 changed files with 178 additions and 149 deletions

View File

@@ -6,6 +6,7 @@ package libopenapi
import (
"bytes"
"fmt"
what_changed "github.com/pb33f/libopenapi/what-changed"
"log/slog"
"net/url"
"os"
@@ -127,7 +128,7 @@ func ExampleNewDocument_fromWithDocumentConfigurationSuccess() {
panic(fmt.Sprintf("cannot create new document: %e", err))
}
_, errors := doc.BuildV3Model()
m, errors := doc.BuildV3Model()
// if anything went wrong when building the v3 model, a slice of errors will be returned
if len(errors) > 0 {
@@ -135,6 +136,10 @@ func ExampleNewDocument_fromWithDocumentConfigurationSuccess() {
} else {
fmt.Println("Digital Ocean spec built successfully")
}
// running this through a change detection, will render out the entire model and
// any stage two rendering for the model will be caught.
what_changed.CompareOpenAPIDocuments(m.Model.GoLow(), m.Model.GoLow())
// Output: Digital Ocean spec built successfully
}