tests: add failing test case for recursive callback reference

This commit is contained in:
Tristan Cartledge
2023-12-04 10:15:31 +00:00
parent 69ba5b875a
commit 2ff7c59585
4 changed files with 49 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
package libopenapi
import (
"bytes"
"fmt"
"log/slog"
"os"
@@ -1170,3 +1171,23 @@ func TestDocument_Render_PreserveOrder(t *testing.T) {
})
})
}
func TestDocument_AdvanceCallbackReferences(t *testing.T) {
bs, _ := os.ReadFile("test_specs/advancecallbackreferences/min-openapi.yaml")
buf := bytes.NewBuffer([]byte{})
config := datamodel.NewDocumentConfiguration()
config.AllowRemoteReferences = true
config.AllowFileReferences = true
config.BasePath = "test_specs/advancecallbackreferences"
config.Logger = slog.New(slog.NewJSONHandler(buf, &slog.HandlerOptions{Level: slog.LevelError}))
doc, err := NewDocumentWithConfiguration(bs, config)
require.NoError(t, err)
_, errs := doc.BuildV3Model()
require.Empty(t, errs)
assert.Empty(t, buf.String())
}