diff --git a/index/spec_index.go b/index/spec_index.go index 36f13a45..9803fd07 100644 --- a/index/spec_index.go +++ b/index/spec_index.go @@ -331,12 +331,9 @@ func (index *SpecIndex) GetAllComponentSchemas() map[string]*Reference { if index != nil && index.allComponentSchemas != nil { return index.allComponentSchemas } - if index != nil && index.allComponentSchemas == nil { - schemaMap := syncMapToMap[string, *Reference](index.allComponentSchemaDefinitions) - index.allComponentSchemas = schemaMap - return index.allComponentSchemas - } - return nil + schemaMap := syncMapToMap[string, *Reference](index.allComponentSchemaDefinitions) + index.allComponentSchemas = schemaMap + return index.allComponentSchemas } // GetAllSecuritySchemes will return all security schemes / definitions found in the document.