mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
@@ -13,6 +13,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@@ -80,7 +81,11 @@ func TestBundleDocument_Circular(t *testing.T) {
|
|||||||
|
|
||||||
bytes, e := BundleDocument(&v3Doc.Model)
|
bytes, e := BundleDocument(&v3Doc.Model)
|
||||||
assert.NoError(t, e)
|
assert.NoError(t, e)
|
||||||
assert.Len(t, *doc.GetSpecInfo().SpecBytes, 1563)
|
if runtime.GOOS != "windows" {
|
||||||
|
assert.Len(t, *doc.GetSpecInfo().SpecBytes, 1563)
|
||||||
|
} else {
|
||||||
|
assert.Len(t, *doc.GetSpecInfo().SpecBytes, 1637)
|
||||||
|
}
|
||||||
assert.Len(t, bytes, 2016)
|
assert.Len(t, bytes, 2016)
|
||||||
|
|
||||||
logEntries := strings.Split(byteBuf.String(), "\n")
|
logEntries := strings.Split(byteBuf.String(), "\n")
|
||||||
|
|||||||
@@ -36,6 +36,19 @@ paths:
|
|||||||
assert.Equal(t, 2, idx.descriptionCount)
|
assert.Equal(t, 2, idx.descriptionCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSpecIndex_ExtractRefs_CheckSummarySummary(t *testing.T) {
|
||||||
|
yml := `things:
|
||||||
|
summary:
|
||||||
|
summary:
|
||||||
|
- summary`
|
||||||
|
var rootNode yaml.Node
|
||||||
|
_ = yaml.Unmarshal([]byte(yml), &rootNode)
|
||||||
|
c := CreateOpenAPIIndexConfig()
|
||||||
|
idx := NewSpecIndexWithConfig(&rootNode, c)
|
||||||
|
assert.Len(t, idx.allSummaries, 3)
|
||||||
|
assert.Equal(t, 3, idx.summaryCount)
|
||||||
|
}
|
||||||
|
|
||||||
func TestSpecIndex_ExtractRefs_CheckPropertiesForInlineSchema(t *testing.T) {
|
func TestSpecIndex_ExtractRefs_CheckPropertiesForInlineSchema(t *testing.T) {
|
||||||
yml := `openapi: 3.1.0
|
yml := `openapi: 3.1.0
|
||||||
servers:
|
servers:
|
||||||
|
|||||||
Reference in New Issue
Block a user