Skip to content

Commit 42f7213

Browse files
committed
Remove unnecessary interface
1 parent 670f641 commit 42f7213

File tree

4 files changed

+3
-60
lines changed

4 files changed

+3
-60
lines changed

src/Microsoft.OpenApi/Interfaces/IEffective.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Microsoft.OpenApi/Models/OpenApiParameter.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.OpenApi.Models
1515
/// <summary>
1616
/// Parameter Object.
1717
/// </summary>
18-
public class OpenApiParameter : IOpenApiReferenceable, IEffective<OpenApiParameter>, IOpenApiExtensible
18+
public class OpenApiParameter : IOpenApiReferenceable, IOpenApiExtensible
1919
{
2020
private bool? _explode;
2121
private ParameterStyle? _style;
@@ -203,23 +203,6 @@ private void SerializeInternal(IOpenApiWriter writer, Action<IOpenApiWriter, IOp
203203
action(writer, target);
204204
}
205205

206-
/// <summary>
207-
/// Returns an effective OpenApiParameter object based on the presence of a $ref
208-
/// </summary>
209-
/// <param name="doc">The host OpenApiDocument that contains the reference.</param>
210-
/// <returns>OpenApiParameter</returns>
211-
public OpenApiParameter GetEffective(OpenApiDocument doc)
212-
{
213-
if (Reference != null)
214-
{
215-
return doc.ResolveReferenceTo<OpenApiParameter>(Reference);
216-
}
217-
else
218-
{
219-
return this;
220-
}
221-
}
222-
223206
/// <summary>
224207
/// Serialize to OpenAPI V3 document without using reference.
225208
/// </summary>

src/Microsoft.OpenApi/Models/OpenApiResponse.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.OpenApi.Models
1212
/// <summary>
1313
/// Response object.
1414
/// </summary>
15-
public class OpenApiResponse : IOpenApiReferenceable, IOpenApiExtensible, IEffective<OpenApiResponse>
15+
public class OpenApiResponse : IOpenApiReferenceable, IOpenApiExtensible
1616
{
1717
/// <summary>
1818
/// REQUIRED. A short description of the response.
@@ -98,23 +98,6 @@ private void SerializeInternal(IOpenApiWriter writer, Action<IOpenApiWriter, IOp
9898
action(writer, target);
9999
}
100100

101-
/// <summary>
102-
/// Returns an effective OpenApiRequestBody object based on the presence of a $ref
103-
/// </summary>
104-
/// <param name="doc">The host OpenApiDocument that contains the reference.</param>
105-
/// <returns>OpenApiResponse</returns>
106-
public OpenApiResponse GetEffective(OpenApiDocument doc)
107-
{
108-
if (Reference != null)
109-
{
110-
return doc.ResolveReferenceTo<OpenApiResponse>(Reference);
111-
}
112-
else
113-
{
114-
return this;
115-
}
116-
}
117-
118101
/// <summary>
119102
/// Serialize to OpenAPI V3 document without using reference.
120103
/// </summary>

test/Microsoft.OpenApi.Readers.Tests/OpenApiWorkspaceTests/OpenApiWorkspaceStreamTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public async Task LoadDocumentWithExternalReferenceShouldLoadBothDocumentsIntoWo
7878
var referencedParameter = result.OpenApiDocument
7979
.Paths["/todos"]
8080
.Operations[OperationType.Get]
81-
.Parameters.Select(p => p.GetEffective(result.OpenApiDocument))
81+
.Parameters.Select(p => p)
8282
.FirstOrDefault(p => p.Name == "filter");
8383

8484
Assert.Equal(SchemaValueType.String, referencedParameter.Schema.GetJsonType());

0 commit comments

Comments
 (0)