Chiron by Andrew Cherry,Michael Newton,Henrik Feldt,Marcus Griep,Tony Williams

<PackageReference Include="Chiron" Version="7.0.0-beta-180105" />

 JsonFailureReasonModule

public static class JsonFailureReasonModule
using Microsoft.FSharp.Core; using System; using System.Globalization; namespace Chiron { [CompilationRepresentation()] [CompilationMapping()] public static class JsonFailureReasonModule { public static string toString(JsonFailureReason _arg1) { switch (_arg1.Tag) { default: { JsonFailureReason.OtherError otherError = (JsonFailureReason.OtherError)_arg1; Exception err = otherError._err; object obj = err; if (obj != null) { IFormattable formattable = obj as IFormattable; if (formattable != null) { IFormattable formattable2 = formattable; return formattable2.ToString(null, (IFormatProvider)CultureInfo.InvariantCulture); } object obj2 = obj; return obj2.ToString(); } return ""; } case 1: { JsonFailureReason.PropertyNotFound propertyNotFound = (JsonFailureReason.PropertyNotFound)_arg1; return "Failed to find expected property: " + propertyNotFound._name; } case 2: { JsonFailureReason.TypeMismatch typeMismatch = (JsonFailureReason.TypeMismatch)_arg1; JsonMemberType expected = typeMismatch._expected; JsonMemberType actual = typeMismatch._actual; return "Expected to find " + JsonMemberTypeModule.describe(expected) + ", but instead found " + JsonMemberTypeModule.describe(actual); } case 3: { JsonFailureReason.DeserializationError deserializationError = (JsonFailureReason.DeserializationError)_arg1; Type targetType = deserializationError._targetType; Exception err = deserializationError._err; string fullName = targetType.FullName; object obj = err; object str; if (obj != null) { IFormattable formattable = obj as IFormattable; if (formattable != null) { IFormattable formattable2 = formattable; str = formattable2.ToString(null, (IFormatProvider)CultureInfo.InvariantCulture); } else { object obj2 = obj; str = obj2.ToString(); } } else str = ""; return "Unable to deserialize value as '" + fullName + "': " + (string)str; } case 4: { JsonFailureReason.InvalidJson invalidJson = (JsonFailureReason.InvalidJson)_arg1; return "Invalid JSON, failed to parse: " + invalidJson._err; } case 5: return "No input was provided"; } } [CompilationArgumentCounts(new int[] { 1, 1 })] public static string toStringWithPath(FSharpOption<string> pathO, JsonFailureReason jFail) { return ((pathO == null) ? string.Empty : pathO.get_Value()) + ": " + toString(jFail); } } }