Skip to content

Commit

Permalink
Remove method from interface to prevent a breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieKimani1 committed Jan 25, 2024
1 parent e3e8fc7 commit fa9306f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
12 changes: 1 addition & 11 deletions src/Microsoft.OpenApi/Writers/IOpenApiWriter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using Microsoft.OpenApi.Models;

namespace Microsoft.OpenApi.Writers
{
/// <summary>
Expand Down Expand Up @@ -74,13 +72,5 @@ public interface IOpenApiWriter
/// Flush the writer.
/// </summary>
void Flush();

/// <summary>
/// Writes out existing examples in a mediatype object
/// </summary>
/// <param name="writer"></param>
/// <param name="example"></param>
/// <param name="version"></param>
void WriteV2Examples(IOpenApiWriter writer, OpenApiExample example, OpenApiSpecVersion version);
}
}
24 changes: 0 additions & 24 deletions src/Microsoft.OpenApi/Writers/OpenApiWriterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.IO;
using Microsoft.OpenApi.Exceptions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Properties;

namespace Microsoft.OpenApi.Writers
Expand Down Expand Up @@ -406,28 +405,5 @@ protected void VerifyCanWritePropertyName(string name)
string.Format(SRResource.ObjectScopeNeededForPropertyNameWriting, name));
}
}

/// <inheritdoc/>
public void WriteV2Examples(IOpenApiWriter writer, OpenApiExample example, OpenApiSpecVersion version)
{
writer.WriteStartObject();

// summary
writer.WriteProperty(OpenApiConstants.Summary, example.Summary);

// description
writer.WriteProperty(OpenApiConstants.Description, example.Description);

// value
writer.WriteOptionalObject(OpenApiConstants.Value, example.Value, (w, v) => w.WriteAny(v));

// externalValue
writer.WriteProperty(OpenApiConstants.ExternalValue, example.ExternalValue);

// extensions
writer.WriteExtensions(example.Extensions, version);

writer.WriteEndObject();
}
}
}

0 comments on commit fa9306f

Please sign in to comment.