Supports missing request body parameter by MIchaelMainer · Pull Request #284 · microsoftgraph/MSGraph-SDK-Code-Generator

Expand Up @@ -500,11 +500,30 @@ public static List<OdcmMethod> WithDistinctOverloads(this OdcmMethod odcmMethod) return methods.Distinct(methodComparer).ToList(); }
private static readonly OdcmParameterEqualityComparer paramComparer = new OdcmParameterEqualityComparer(); /// <summary> /// Deduplicates the parameter list for an overloaded method. /// </summary> /// <param name="odcmMethod">Method with potential overloads and duplicate parameters across overloads.</param> /// <returns>A deduplicated list of OdcmParameter.</returns> public static List<OdcmParameter> WithDistinctParameters(this OdcmMethod odcmMethod) { var distinctMethods = odcmMethod.WithDistinctOverloads();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MIchaelMainer I love it, building on what I added a couple of weeks ago ❤


var parameters = new List<OdcmParameter>();
foreach (var method in distinctMethods) { parameters.AddRange(method.Parameters); }
return parameters.Distinct(paramComparer).ToList(); }
/// Returns a List containing the supplied class' methods plus their overloads public static IEnumerable<OdcmMethod> MethodsAndOverloads(this OdcmClass odcmClass) { return odcmClass.Methods.SelectMany(x => x.WithOverloads()); } }
}