mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 20:47:49 +00:00
Added in high document API
filling out documentation, looking at DX and how to consume things, re-shuffling and cleaning house.
This commit is contained in:
@@ -563,3 +563,18 @@ func DetectCase(input string) Case {
|
||||
}
|
||||
return RegularCase
|
||||
}
|
||||
|
||||
// CheckEnumForDuplicates will check an array of nodes to check if there are any duplicate values.
|
||||
func CheckEnumForDuplicates(seq []*yaml.Node) []*yaml.Node {
|
||||
var res []*yaml.Node
|
||||
seen := make(map[string]*yaml.Node)
|
||||
|
||||
for _, enum := range seq {
|
||||
if seen[enum.Value] != nil {
|
||||
res = append(res, enum)
|
||||
continue
|
||||
}
|
||||
seen[enum.Value] = enum
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user