INNER CODE UNIT · Go
verifyOperationMappings
stacklok/toolhive · cmd/help/openapi-normalize/main.go:363
func verifyOperationMappings(encountered map[string]bool, mappings map[string]string) error {
for operationKey := range mappings {
if !encountered[operationKey] {
return fmt.Errorf("operation override is stale for %s", operationKey)
}
}
return nil
}
func normalizeOpenAPIResponse(operation map[string]any) error {
responses, ok := object(operation["responses"])
if !ok {
return fmt.Errorf("OpenAPI specification operation has no responses")
}
response, ok := object(responses["200"])
if !ok {
return fmt.Errorf("OpenAPI specification operation has no 200 response")
}