func validOperationSearch(operation *openapiv3.Operation, path []string) []*Incompatibility {
	var incompatibilities []*Incompatibility
	if operation == nil {
		return incompatibilities
	}
	if operation.Callbacks != nil {
		incompatibilities = append(incompatibilities,
			newIncompatibility(IncompatibiltiyClassification_ExternalTranscodingSupport, extendPath(path, "callbacks")...))
	}
	if operation.Security != nil || len(operation.Security) != 0 {
		incompatibilities = append(incompatibilities,
			newIncompatibility(IncompatibiltiyClassification_Security, extendPath(path, "security")...))
	}
	for ind, paramOrRef := range operation.Parameters {
		incompatibilities = append(incompatibilities, parametersSearch(paramOrRef.GetParameter(), extendPath(path, "parameters", strconv.Itoa(ind)))...)
	}
	return incompatibilities
}
========================= Helper Functions ======================== //
validOperationSearch scans for incompatibilities within valid operations
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
}
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
}
func ComponentsSearch(doc *openapiv3.Document) []*Incompatibility {
	var incompatibilities []*Incompatibility
	if doc.Components == nil {
		return incompatibilities
	}
	path := []string{"components"}
	if doc.Components.Callbacks != nil {
		incompatibilities = append(incompatibilities,
			newIncompatibility(IncompatibiltiyClassification_ExternalTranscodingSupport, extendPath(path, "callbacks")...))
	}
	if doc.Components.Schemas != nil {
		for _, schemaRef := range doc.Components.Schemas.GetAdditionalProperties() {
			incompatibilities = append(incompatibilities, schemaSearch(schemaRef.Value.GetSchema(), extendPath(path, "schemas", schemaRef.Name))...)
		}
	}
	if doc.Components.Responses != nil {
		for _, resRef := range doc.Components.Responses.GetAdditionalProperties() {
			incompatibilities = append(incompatibilities,
				responseSearch(resRef.Value.GetResponse(), extendPath(path, "requestBodies", resRef.Name))...,
			)
		}
	}
	if doc.Components.Parameters != nil {
		for _, paramRef := range doc.Components.Parameters.GetAdditionalProperties() {
			incompatibilities = append(incompatibilities,
				parametersSearch(paramRef.GetValue().GetParameter(), extendPath(path, "parameters", paramRef.Name))...,
			)
		}
	}
	if doc.Components.RequestBodies != nil {
		for _, reqRef := range doc.Components.RequestBodies.GetAdditionalProperties() {
			incompatibilities = append(incompatibilities,
				requestBodySearch(reqRef.Value.GetRequestBody(), extendPath(path, "requestBodies", reqRef.Name))...,
			)
		}
	}
	if doc.Components.Headers != nil {
		for _, comRef := range doc.Components.Headers.GetAdditionalProperties() {
			incompatibilities = append(incompatibilities,
				headerSearch(comRef.Name, comRef.Value.GetHeader(), extendPath(path, "headers", comRef.Name))...,
			)
		}
	}
	if doc.Components.SecuritySchemes != nil {
		incompatibilities = append(incompatibilities, newIncompatibility(IncompatibiltiyClassification_Security, extendPath(path, "securitySchemes")...))
	}
	return incompatibilities
}