mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user