func (c *GrpcChecker) analyzeOperation(operation *openapiv3.Operation, parentKeys []string) {
	currentKeys := parentKeys
	fields := getNotSupportedOperationFields(operation)
	if len(operation.OperationId) == 0 {
		text := "One of your operations does not have an 'operationId'. gnostic-grpc might produce an incorrect output file."
		msg := constructWarningMessage("OPERATION", text, currentKeys)
		c.messages = append(c.messages, &msg)
	}
	for _, f := range fields {
		text := "Field: '" + f + "' is not supported for operation: " + operation.OperationId
		msg := constructInfoMessage("OPERATIONFIELDS", text, append(copyKeys(currentKeys), f))
		c.messages = append(c.messages, &msg)
	}
	for _, param := range operation.Parameters {
		pKeys := append(currentKeys, "parameters")
		c.analyzeParameter(param, pKeys)
	}
	for _, response := range operation.Responses.GetResponseOrReference() {
		pKeys := append(currentKeys, "responses")
		c.analyzeResponse(response, pKeys)
	}
	if defaultResponse := operation.Responses.Default; defaultResponse != nil {
		wrap := &openapiv3.NamedResponseOrReference{Name: "default", Value: defaultResponse}
		pKeys := append(currentKeys, "responses")
		c.analyzeResponse(wrap, pKeys)
	}
	pKeys := append(currentKeys, "requestBody")
	wrap := &openapiv3.NamedRequestBodyOrReference{Name: operation.OperationId, Value: operation.RequestBody}
	c.analyzeRequestBody(wrap, pKeys)
}
Analyzes a single Operation.
package generator
import (
	openapiv3 "github.com/google/gnostic/openapiv3"
	plugins "github.com/google/gnostic/plugins"
)
type GrpcChecker struct {
	document *openapiv3.Document
	messages []*plugins.Message
}
func NewGrpcChecker(document *openapiv3.Document) *GrpcChecker {
	return &GrpcChecker{document: document, messages: make([]*plugins.Message, 0)}
}
func (c *GrpcChecker) Run() []*plugins.Message {
	c.analyzeOpenAPIDocument()
	return c.messages
}
func (c *GrpcChecker) analyzeOpenAPIDocument() {
	fields := getNotSupportedOpenAPIDocumentFields(c.document)
	for _, f := range fields {
		text := "Field: '" + f + "' is not supported for the OpenAPI document with title: " + c.document.Info.Title
		msg := constructInfoMessage("DOCUMENTFIELDS", text, []string{f})
		c.messages = append(c.messages, &msg)
	}
	c.analyzeComponents()
	c.analyzePaths()
}
func (c *GrpcChecker) analyzeComponents() {
	components := c.document.Components
	currentKeys := []string{"components"}
	fields := getNotSupportedComponentsFields(components)
	for _, f := range fields {
		text := "Field: '" + f + "' is not supported for the component"
		msg := constructInfoMessage("COMPONENTSFIELDS", text, append(copyKeys(currentKeys), f))
		c.messages = append(c.messages, &msg)
	}
	if schemas := components.GetSchemas(); schemas != nil {
		for _, pair := range schemas.AdditionalProperties {
			parentKeys := append(currentKeys, []string{"schemas", pair.Name}...)
			c.analyzeSchema(pair.Name, pair.Value, parentKeys)
		}
	}
	if responses := components.GetResponses(); responses != nil {
		for _, pair := range responses.AdditionalProperties {
			parentKeys := append(currentKeys, "responses")
			c.analyzeResponse(pair, parentKeys)
		}
	}
	if parameters := components.GetParameters(); parameters != nil {
		for _, pair := range parameters.AdditionalProperties {
			parentKeys := append(currentKeys, "parameters")
			c.analyzeParameter(pair.Value, parentKeys)
		}
	}
	if requestBodies := components.GetRequestBodies(); requestBodies != nil {
		for _, pair := range requestBodies.AdditionalProperties {
			parentKeys := append(currentKeys, []string{"requestBodies", pair.Name}...)
			c.analyzeRequestBody(pair, parentKeys)
		}
	}
}
func (c *GrpcChecker) analyzePaths() {
	currentKeys := []string{"paths"}
	for _, pathItem := range c.document.Paths.Path {
		c.analyzePathItem(pathItem, currentKeys)
	}
}
func (c *GrpcChecker) analyzePathItem(pair *openapiv3.NamedPathItem, parentKeys []string) {
	pathItem := pair.Value
	currentKeys := append(parentKeys, pair.Name)
	fields := getNotSupportedPathItemFields(pathItem)
	for _, f := range fields {
		text := "Field: '" + f + "' is not supported for path: " + pair.Name
		msg := constructInfoMessage("PATHFIELDS", text, append(copyKeys(currentKeys), f))
		c.messages = append(c.messages, &msg)
	}
	operations, operationType := getValidOperations(pathItem)
	for idx, op := range operations {
		pKeys := append(currentKeys, operationType[idx])
		c.analyzeOperation(op, pKeys)
	}
}