Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor in Microsoft.OpenApi #6461

Merged
merged 10 commits into from
Jan 14, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
<type fullname="System.Diagnostics.DebuggerBrowsableState" />
<type fullname="System.Diagnostics.DebuggerDisplayAttribute" />
<type fullname="System.Diagnostics.DebuggerHiddenAttribute" />
<type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute" />
<type fullname="System.Diagnostics.DebuggerStepThroughAttribute" />
<type fullname="System.Diagnostics.DebuggerTypeProxyAttribute" />
</assembly>
Expand All @@ -246,6 +247,7 @@
<type fullname="System.Diagnostics.SymbolStore.SymDocumentType" />
</assembly>
<assembly fullname="System.Diagnostics.Tools">
<type fullname="System.CodeDom.Compiler.GeneratedCodeAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" />
</assembly>
<assembly fullname="System.Diagnostics.TraceSource">
Expand Down Expand Up @@ -494,6 +496,7 @@
<type fullname="System.Buffers.SpanAction`2" />
<type fullname="System.Byte" />
<type fullname="System.Char" />
<type fullname="System.CodeDom.Compiler.GeneratedCodeAttribute" />
<type fullname="System.Collections.ArrayList" />
<type fullname="System.Collections.DictionaryEntry" />
<type fullname="System.Collections.Generic.ICollection`1" />
Expand Down Expand Up @@ -538,6 +541,8 @@
<type fullname="System.Diagnostics.CodeAnalysis.AllowNullAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes" />
<type fullname="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.MaybeNullAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute" />
Expand All @@ -546,6 +551,8 @@
<type fullname="System.Diagnostics.CodeAnalysis.NotNullAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.NotNullWhenAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute" />
<type fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute" />
<type fullname="System.Diagnostics.ConditionalAttribute" />
<type fullname="System.Diagnostics.DebuggableAttribute" />
<type fullname="System.Diagnostics.DebuggableAttribute/DebuggingModes" />
Expand All @@ -554,6 +561,7 @@
<type fullname="System.Diagnostics.DebuggerBrowsableState" />
<type fullname="System.Diagnostics.DebuggerDisplayAttribute" />
<type fullname="System.Diagnostics.DebuggerHiddenAttribute" />
<type fullname="System.Diagnostics.DebuggerNonUserCodeAttribute" />
<type fullname="System.Diagnostics.DebuggerStepThroughAttribute" />
<type fullname="System.Diagnostics.DebuggerTypeProxyAttribute" />
<type fullname="System.Diagnostics.StackTraceHiddenAttribute" />
Expand Down Expand Up @@ -719,6 +727,7 @@
<type fullname="System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1" />
<type fullname="System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder" />
<type fullname="System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1" />
<type fullname="System.Runtime.CompilerServices.CallerArgumentExpressionAttribute" />
<type fullname="System.Runtime.CompilerServices.CallerFilePathAttribute" />
<type fullname="System.Runtime.CompilerServices.CallerLineNumberAttribute" />
<type fullname="System.Runtime.CompilerServices.CompilationRelaxationsAttribute" />
Expand Down Expand Up @@ -970,7 +979,10 @@
</assembly>
<assembly fullname="System.Security.Cryptography.Primitives">
<type fullname="System.Security.Cryptography.AsymmetricAlgorithm" />
<type fullname="System.Security.Cryptography.CryptoStream" />
<type fullname="System.Security.Cryptography.CryptoStreamMode" />
<type fullname="System.Security.Cryptography.HashAlgorithm" />
<type fullname="System.Security.Cryptography.ICryptoTransform" />
</assembly>
<assembly fullname="System.Text.Encoding.Extensions">
<type fullname="System.Text.UnicodeEncoding" />
Expand Down
3 changes: 2 additions & 1 deletion tracer/src/Datadog.Trace/Configuration/IntegrationId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal enum IntegrationId
DirectoryListingLeak,
SessionTimeout,
DatadogTraceManual,
EmailHtmlInjection
EmailHtmlInjection,
Protobuf
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions
/// The number of members in the enum.
/// This is a non-distinct count of defined names.
/// </summary>
public const int Length = 72;
public const int Length = 73;

/// <summary>
/// Returns the string representation of the <see cref="Datadog.Trace.Configuration.IntegrationId"/> value.
Expand Down Expand Up @@ -102,6 +102,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId
Datadog.Trace.Configuration.IntegrationId.SessionTimeout => nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection => nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
Datadog.Trace.Configuration.IntegrationId.Protobuf => nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
_ => value.ToString(),
};

Expand Down Expand Up @@ -187,6 +188,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues()
Datadog.Trace.Configuration.IntegrationId.SessionTimeout,
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual,
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection,
Datadog.Trace.Configuration.IntegrationId.Protobuf,
};

/// <summary>
Expand Down Expand Up @@ -272,5 +274,6 @@ public static string[] GetNames()
nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions
/// The number of members in the enum.
/// This is a non-distinct count of defined names.
/// </summary>
public const int Length = 72;
public const int Length = 73;

/// <summary>
/// Returns the string representation of the <see cref="Datadog.Trace.Configuration.IntegrationId"/> value.
Expand Down Expand Up @@ -102,6 +102,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId
Datadog.Trace.Configuration.IntegrationId.SessionTimeout => nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection => nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
Datadog.Trace.Configuration.IntegrationId.Protobuf => nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
_ => value.ToString(),
};

Expand Down Expand Up @@ -187,6 +188,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues()
Datadog.Trace.Configuration.IntegrationId.SessionTimeout,
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual,
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection,
Datadog.Trace.Configuration.IntegrationId.Protobuf,
};

/// <summary>
Expand Down Expand Up @@ -272,5 +274,6 @@ public static string[] GetNames()
nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions
/// The number of members in the enum.
/// This is a non-distinct count of defined names.
/// </summary>
public const int Length = 72;
public const int Length = 73;

/// <summary>
/// Returns the string representation of the <see cref="Datadog.Trace.Configuration.IntegrationId"/> value.
Expand Down Expand Up @@ -102,6 +102,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId
Datadog.Trace.Configuration.IntegrationId.SessionTimeout => nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection => nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
Datadog.Trace.Configuration.IntegrationId.Protobuf => nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
_ => value.ToString(),
};

Expand Down Expand Up @@ -187,6 +188,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues()
Datadog.Trace.Configuration.IntegrationId.SessionTimeout,
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual,
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection,
Datadog.Trace.Configuration.IntegrationId.Protobuf,
};

/// <summary>
Expand Down Expand Up @@ -272,5 +274,6 @@ public static string[] GetNames()
nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions
/// The number of members in the enum.
/// This is a non-distinct count of defined names.
/// </summary>
public const int Length = 72;
public const int Length = 73;

/// <summary>
/// Returns the string representation of the <see cref="Datadog.Trace.Configuration.IntegrationId"/> value.
Expand Down Expand Up @@ -102,6 +102,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId
Datadog.Trace.Configuration.IntegrationId.SessionTimeout => nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection => nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
Datadog.Trace.Configuration.IntegrationId.Protobuf => nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
_ => value.ToString(),
};

Expand Down Expand Up @@ -187,6 +188,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues()
Datadog.Trace.Configuration.IntegrationId.SessionTimeout,
Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual,
Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection,
Datadog.Trace.Configuration.IntegrationId.Protobuf,
};

/// <summary>
Expand Down Expand Up @@ -272,5 +274,6 @@ public static string[] GetNames()
nameof(Datadog.Trace.Configuration.IntegrationId.SessionTimeout),
nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceManual),
nameof(Datadog.Trace.Configuration.IntegrationId.EmailHtmlInjection),
nameof(Datadog.Trace.Configuration.IntegrationId.Protobuf),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,54 +86,5 @@ public static OpenApiSchema MapTypeToOpenApiPrimitiveType(this Type type)
? result()
: new() { Type = "string" };
}

/// <summary>
/// Maps an OpenAPI data type and format to a simple type.
/// </summary>
/// <param name="schema">The OpenApi data type</param>
/// <returns>The simple type</returns>
/// <exception cref="ArgumentNullException"></exception>
public static Type MapOpenApiPrimitiveTypeToSimpleType(this OpenApiSchema schema)
vandonr marked this conversation as resolved.
Show resolved Hide resolved
{
if (schema == null)
{
throw new ArgumentNullException(nameof(schema));
}

var type = (schema.Type?.ToLowerInvariant(), schema.Format?.ToLowerInvariant(), schema.Nullable) switch
{
("boolean", null, false) => typeof(bool),
("integer", "int32", false) => typeof(int),
("integer", "int64", false) => typeof(long),
("integer", null, false) => typeof(int),
("number", "float", false) => typeof(float),
("number", "double", false) => typeof(double),
("number", "decimal", false) => typeof(decimal),
("number", null, false) => typeof(double),
("string", "byte", false) => typeof(byte),
("string", "date-time", false) => typeof(DateTimeOffset),
("string", "uuid", false) => typeof(Guid),
("string", "duration", false) => typeof(TimeSpan),
("string", "char", false) => typeof(char),
("string", null, false) => typeof(string),
("object", null, false) => typeof(object),
("string", "uri", false) => typeof(Uri),
("integer", "int32", true) => typeof(int?),
("integer", "int64", true) => typeof(long?),
("integer", null, true) => typeof(int?),
("number", "float", true) => typeof(float?),
("number", "double", true) => typeof(double?),
("number", null, true) => typeof(double?),
("number", "decimal", true) => typeof(decimal?),
("string", "byte", true) => typeof(byte?),
("string", "date-time", true) => typeof(DateTimeOffset?),
("string", "uuid", true) => typeof(Guid?),
("string", "char", true) => typeof(char?),
("boolean", null, true) => typeof(bool?),
_ => typeof(string),
};

return type;
}
}
}
Loading
Loading