func PathsSearch(doc *openapiv3.Document) []*Incompatibility {
	var incompatibilities []*Incompatibility
	path := []string{"paths"}
	if doc.Paths == nil {
		return incompatibilities
	}
	for _, pathItem := range doc.Paths.Path {
		pathKey := extendPath(path, pathItem.Name)
		path := pathItem.Value
		if path.Head != nil {
			incompatibilities = append(incompatibilities,
				newIncompatibility(IncompatibiltiyClassification_InvalidOperation, extendPath(pathKey, "head")...))
		}
		if path.Options != nil {
			incompatibilities = append(incompatibilities,
				newIncompatibility(IncompatibiltiyClassification_InvalidOperation, extendPath(pathKey, "options")...))
		}
		if path.Trace != nil {
			incompatibilities = append(incompatibilities,
				newIncompatibility(IncompatibiltiyClassification_InvalidOperation, extendPath(pathKey, "trace")...))
		}
		incompatibilities = append(incompatibilities,
			validOperationSearch(path.Get, extendPath(pathKey, "get"))...)
		incompatibilities = append(incompatibilities,
			validOperationSearch(path.Put, extendPath(pathKey, "put"))...)
		incompatibilities = append(incompatibilities,
			validOperationSearch(path.Post, extendPath(pathKey, "post"))...)
		incompatibilities = append(incompatibilities,
			validOperationSearch(path.Delete, extendPath(pathKey, "delete"))...)
		incompatibilities = append(incompatibilities,
			validOperationSearch(path.Patch, extendPath(pathKey, "patch"))...)
		for ind, paramOrRef := range path.Parameters {
			incompatibilities = append(incompatibilities,
				parametersSearch(paramOrRef.GetParameter(), extendPath(pathKey, "parameters", strconv.Itoa(ind)))...)
		}
	}
	return incompatibilities
}
PathsSearch is a reporter that scans for incompatibilities in the paths component of an OpenAPI doc
package incompatibility
import (
	"strconv"
	openapiv3 "github.com/google/gnostic/openapiv3"
)
var IncompatibilityReporters []IncompatibilityReporter = []IncompatibilityReporter{
	DocumentBaseSearch,
	PathsSearch,
	ComponentsSearch,
}
type IncompatibilityReporter func(*openapiv3.Document) []*Incompatibility
func aggregateIncompatibilityReporters(reporters ...IncompatibilityReporter) IncompatibilityReporter {
	return func(doc *openapiv3.Document) []*Incompatibility {
		var incompatibilities []*Incompatibility
		for _, reporter := range reporters {
			incompatibilities = append(incompatibilities, reporter(doc)...)
		}
		return incompatibilities
	}
}
func ReportOnDoc(doc *openapiv3.Document, reportIdentifier string, reporters ...IncompatibilityReporter) *IncompatibilityReport {
	return &IncompatibilityReport{
		ReportIdentifier:  reportIdentifier,
		Incompatibilities: aggregateIncompatibilityReporters(reporters...)(doc)}
}
func DocumentBaseSearch(doc *openapiv3.Document) []*Incompatibility {
	var incompatibilities []*Incompatibility
	if doc.Security == nil || len(doc.Security) == 0 {
		return incompatibilities
	}
	incompatibilities = append(incompatibilities,
		newIncompatibility(IncompatibiltiyClassification_Security, "security"))
	return incompatibilities
}