func DepthFirst(in interface{}) []string
DepthFirst sorts a map of anything. It groups keys by category (shared params, op param, statuscode response, default response, definitions) sort groups internally by number of parts in the key and lexical names flatten groups into a single list of keys
func ReverseIndex(schemas map[string]spec.Ref, basePath string) map[string]RefRevIdx
ReverseIndex builds a reverse index for references in schemas
func TopmostFirst(refs []string) []string
TopmostFirst sorts references by depth
Key represent a key item constructed from /-separated segments
type Key struct { Segments int Key string }
Keys is a sortable collable collection of Keys
type Keys []Key
func (k Keys) Len() int
func (k Keys) Less(i, j int) bool
func (k Keys) Swap(i, j int)
PartAdder know how to construct the components of a new name
type PartAdder func(string) []string
RefRevIdx is a reverse index for references
type RefRevIdx struct { Ref spec.Ref Keys []string }
SplitKey holds of the parts of a /-separated key, so that their location may be determined.
type SplitKey []string
func KeyParts(key string) SplitKey
KeyParts construct a SplitKey with all its /-separated segments decomposed. It is sortable.
func (s SplitKey) BuildName(segments []string, startIndex int, adder PartAdder) string
BuildName builds a name from segments
func (s SplitKey) DefinitionName() string
DefinitionName yields the name of the definition
func (s SplitKey) IsDefaultResponse() bool
IsDefaultResponse is true when the split key is the default response for an operation
func (s SplitKey) IsDefinition() bool
IsDefinition is true when the split key is in the #/definitions section of a spec
func (s SplitKey) IsOperation() bool
IsOperation is true when the split key is in the operations section
func (s SplitKey) IsOperationParam() bool
IsOperationParam is true when the split key is in the parameters section of an operation
func (s SplitKey) IsOperationResponse() bool
IsOperationResponse is true when the split key is in the responses section of an operation
func (s SplitKey) IsSharedOperationParam() bool
IsSharedOperationParam is true when the split key is in the parameters section of a path
func (s SplitKey) IsSharedParam() bool
IsSharedParam is true when the split key is in the #/parameters section of a spec
func (s SplitKey) IsSharedResponse() bool
IsSharedResponse is true when the split key is in the #/responses section of a spec
func (s SplitKey) IsStatusCodeResponse() bool
IsStatusCodeResponse is true when the split key is an operation response with a status code
func (s SplitKey) PathItemRef() spec.Ref
PathItemRef constructs a $ref object from a split key of the form /{path}/{method}
func (s SplitKey) PathRef() spec.Ref
PathRef constructs a $ref object from a split key of the form /paths/{reference}
func (s SplitKey) ResponseName() string
ResponseName yields either the status code or "Default" for a response