mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 12:37:48 +00:00
Merge branch 'main' into ordered-libopenapi
This commit is contained in:
@@ -562,6 +562,7 @@ func (index *SpecIndex) ExtractComponentsFromRefs(refs []*Reference) []*Referenc
|
|||||||
if index.allMappedRefs[ref.FullDefinition] == nil {
|
if index.allMappedRefs[ref.FullDefinition] == nil {
|
||||||
found = append(found, located)
|
found = append(found, located)
|
||||||
index.allMappedRefs[located.FullDefinition] = located
|
index.allMappedRefs[located.FullDefinition] = located
|
||||||
|
}
|
||||||
rm := &ReferenceMapped{
|
rm := &ReferenceMapped{
|
||||||
OriginalReference: ref,
|
OriginalReference: ref,
|
||||||
Reference: located,
|
Reference: located,
|
||||||
@@ -569,7 +570,6 @@ func (index *SpecIndex) ExtractComponentsFromRefs(refs []*Reference) []*Referenc
|
|||||||
FullDefinition: located.FullDefinition,
|
FullDefinition: located.FullDefinition,
|
||||||
}
|
}
|
||||||
sequence[refIndex] = rm
|
sequence[refIndex] = rm
|
||||||
}
|
|
||||||
index.refLock.Unlock()
|
index.refLock.Unlock()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -688,8 +688,8 @@ func TestResolver_ResolveComponents_MixedRef(t *testing.T) {
|
|||||||
|
|
||||||
// in v0.8.2 a new check was added when indexing, to prevent re-indexing the same file multiple times.
|
// in v0.8.2 a new check was added when indexing, to prevent re-indexing the same file multiple times.
|
||||||
assert.Equal(t, 6, resolver.GetRelativesSeen())
|
assert.Equal(t, 6, resolver.GetRelativesSeen())
|
||||||
assert.Equal(t, 5, resolver.GetJourneysTaken())
|
assert.Equal(t, 6, resolver.GetJourneysTaken())
|
||||||
assert.Equal(t, 7, resolver.GetReferenceVisited())
|
assert.Equal(t, 8, resolver.GetReferenceVisited())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestResolver_ResolveComponents_k8s(t *testing.T) {
|
func TestResolver_ResolveComponents_k8s(t *testing.T) {
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ func TestSpecIndex_BurgerShop(t *testing.T) {
|
|||||||
assert.Len(t, index.allRefs, mappedRefs)
|
assert.Len(t, index.allRefs, mappedRefs)
|
||||||
assert.Len(t, index.allMappedRefs, mappedRefs)
|
assert.Len(t, index.allMappedRefs, mappedRefs)
|
||||||
assert.Equal(t, mappedRefs, len(index.GetMappedReferences()))
|
assert.Equal(t, mappedRefs, len(index.GetMappedReferences()))
|
||||||
assert.Equal(t, mappedRefs, len(index.GetMappedReferencesSequenced()))
|
assert.Equal(t, mappedRefs+1, len(index.GetMappedReferencesSequenced()))
|
||||||
|
|
||||||
assert.Equal(t, 6, index.pathCount)
|
assert.Equal(t, 6, index.pathCount)
|
||||||
assert.Equal(t, 6, index.GetPathCount())
|
assert.Equal(t, 6, index.GetPathCount())
|
||||||
@@ -1077,7 +1077,7 @@ func TestSpecIndex_lookupFileReference_MultiRes(t *testing.T) {
|
|||||||
assert.NotNil(t, embieRoloFile)
|
assert.NotNil(t, embieRoloFile)
|
||||||
|
|
||||||
index := rolo.GetRootIndex()
|
index := rolo.GetRootIndex()
|
||||||
// index.seenRemoteSources = make(map[string]*yaml.Node)
|
//index.seenRemoteSources = make(map[string]*yaml.Node)
|
||||||
absoluteRef, _ := filepath.Abs("embie.yaml#/naughty")
|
absoluteRef, _ := filepath.Abs("embie.yaml#/naughty")
|
||||||
fRef, _ := index.SearchIndexForReference(absoluteRef)
|
fRef, _ := index.SearchIndexForReference(absoluteRef)
|
||||||
assert.NotNil(t, fRef)
|
assert.NotNil(t, fRef)
|
||||||
|
|||||||
Reference in New Issue
Block a user