private XPathNavigator GetTypeNode(Type type) { string controllerTypeName = GetTypeName(type); string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName); var doc = SwaggerGen.GetXPathDocument(type); return(doc == null ? null : doc.SelectSingleNode(selectExpression)); }
private XPathNavigator GetMemberNode(HttpActionDescriptor actionDescriptor) { ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor; if (reflectedActionDescriptor != null) { string selectExpression = string.Format(_methodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo)); var doc = SwaggerGen.GetXPathDocument(reflectedActionDescriptor.MethodInfo.DeclaringType); if (doc != null) { XPathNavigator node = doc.SelectSingleNode(selectExpression); if (node != null) { return(node); } } } return(null); }