mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
Fixed other references to "root.yaml"
This commit is contained in:
@@ -25,6 +25,10 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
const (
|
||||
theoreticalRoot = "root.yaml"
|
||||
)
|
||||
|
||||
// NewSpecIndexWithConfig will create a new index of an OpenAPI or Swagger spec. It uses the same logic as NewSpecIndex
|
||||
// except it sets a base URL for resolving relative references, except it also allows for granular control over
|
||||
// how the index is set up.
|
||||
@@ -152,6 +156,13 @@ func (index *SpecIndex) GetRolodex() *Rolodex {
|
||||
return index.rolodex
|
||||
}
|
||||
|
||||
func (index *SpecIndex) GetSpecFileName() string {
|
||||
if index == nil || index.rolodex == nil || index.rolodex.indexConfig == nil {
|
||||
return theoreticalRoot
|
||||
}
|
||||
return index.rolodex.indexConfig.SpecFilePath
|
||||
}
|
||||
|
||||
// GetGlobalTagsNode returns document root tags node.
|
||||
func (index *SpecIndex) GetGlobalTagsNode() *yaml.Node {
|
||||
return index.tagsNode
|
||||
|
||||
Reference in New Issue
Block a user