You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class OpenApiLogoExtension : IOpenApiExtension
{
public static string Name => "x-logo";
#pragma warning disable CA1056
public string? Url
#pragma warning restore CA1056
{
get; set;
}
public static OpenApiLogoExtension Parse(JsonNode source)
{
if (source is not JsonObject rawObject) throw new ArgumentOutOfRangeException(nameof(source));
var extension = new OpenApiLogoExtension();
if (rawObject.TryGetPropertyValue(nameof(Url).ToFirstCharacterLowerCase(), out var url) && url is JsonValue urlValue && urlValue.GetValueKind() is JsonValueKind.String && urlValue.TryGetValue<string>(out var urlStrValue))
{
extension.Url = urlStrValue;
}
return extension;
}
public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)
{
ArgumentNullException.ThrowIfNull(writer);
// Only write the object if there's actual content to write