INNER CODE UNIT · Go

isHTTPMethod

stacklok/toolhive · cmd/help/openapi-normalize/main.go:515

func isHTTPMethod(method string) bool {
	switch strings.ToLower(method) {
	case "get", "put", "post", "delete", "patch", "head", "options", "trace":
		return true
	default:
		return false
	}
}

func object(value any) (map[string]any, bool) {
	object, ok := value.(map[string]any)
	return object, ok
}

func stringsSlice(value any) ([]string, bool) {
	if values, ok := value.([]string); ok {
		return values, true
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…