Skip to content

Commit e861c08

Browse files
committed
fix: removes all obsolete APIs
1 parent cce2495 commit e861c08

File tree

4 files changed

+1
-82
lines changed

4 files changed

+1
-82
lines changed

src/Microsoft.OpenApi/Interfaces/IStreamLoader.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license.
33

44
using System;
5-
using System.ComponentModel;
65
using System.IO;
76
using System.Threading.Tasks;
87
using Microsoft.OpenApi.Models;
@@ -20,14 +19,5 @@ public interface IStreamLoader
2019
/// <param name="uri">Identifier of some source of an OpenAPI Description</param>
2120
/// <returns>A data object that can be processed by a reader to generate an <see cref="OpenApiDocument"/></returns>
2221
Task<Stream> LoadAsync(Uri uri);
23-
24-
/// <summary>
25-
/// Use Uri to locate data and convert into an input object.
26-
/// </summary>
27-
/// <param name="uri"></param>
28-
/// <returns></returns>
29-
[Obsolete("Use the Async overload")]
30-
[EditorBrowsable(EditorBrowsableState.Never)]
31-
Stream Load(Uri uri);
3222
}
3323
}

src/Microsoft.OpenApi/Reader/Services/DefaultStreamLoader.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license.
33

44
using System;
5-
using System.ComponentModel;
65
using System.IO;
76
using System.Net.Http;
87
using System.Threading.Tasks;
@@ -17,7 +16,7 @@ namespace Microsoft.OpenApi.Reader.Services
1716
public class DefaultStreamLoader : IStreamLoader
1817
{
1918
private readonly Uri baseUrl;
20-
private HttpClient _httpClient = new();
19+
private readonly HttpClient _httpClient = new();
2120

2221
/// <summary>
2322
/// The default stream loader
@@ -27,16 +26,6 @@ public DefaultStreamLoader(Uri baseUrl)
2726
{
2827
this.baseUrl = baseUrl;
2928
}
30-
/// <inheritdoc/>
31-
32-
[Obsolete]
33-
[EditorBrowsable(EditorBrowsableState.Never)]
34-
public Stream Load(Uri uri)
35-
{
36-
#pragma warning disable VSTHRD002 // Avoid problematic synchronous waits
37-
return LoadAsync(uri).GetAwaiter().GetResult();
38-
#pragma warning restore VSTHRD002 // Avoid problematic synchronous waits
39-
}
4029

4130
/// <summary>
4231
/// Use Uri to locate data and convert into an input object.

src/Microsoft.OpenApi/Validations/ValidationRule.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ public class ValidationRule<T> : ValidationRule
4444
{
4545
private readonly Action<IValidationContext, T> _validate;
4646

47-
/// <summary>
48-
/// Initializes a new instance of the <see cref="ValidationRule"/> class.
49-
/// </summary>
50-
/// <param name="validate">Action to perform the validation.</param>
51-
[Obsolete("Please use the other constructor and specify a name")]
52-
public ValidationRule(Action<IValidationContext, T> validate)
53-
: this (Guid.NewGuid().ToString("D"), validate)
54-
{
55-
}
56-
5747
/// <summary>
5848
/// Initializes a new instance of the <see cref="ValidationRule"/> class.
5949
/// </summary>

src/Microsoft.OpenApi/Writers/OpenApiWriterSettings.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,13 @@
55

66
namespace Microsoft.OpenApi.Writers
77
{
8-
/// <summary>
9-
/// Indicates if and when the writer should convert references into complete object renderings
10-
/// </summary>
11-
[Obsolete("Use InlineLocalReference and InlineExternalReference settings instead")]
12-
public enum ReferenceInlineSetting
13-
{
14-
/// <summary>
15-
/// Render all references as $ref.
16-
/// </summary>
17-
DoNotInlineReferences,
18-
/// <summary>
19-
/// Render all local references as inline objects
20-
/// </summary>
21-
InlineLocalReferences,
22-
/// <summary>
23-
/// Render all references as inline objects.
24-
/// </summary>
25-
InlineAllReferences
26-
}
27-
288
/// <summary>
299
/// Configuration settings to control how OpenAPI documents are written
3010
/// </summary>
3111
public class OpenApiWriterSettings
3212
{
33-
[Obsolete("Use InlineLocalReference and InlineExternalReference settings instead")]
34-
private ReferenceInlineSetting referenceInline = ReferenceInlineSetting.DoNotInlineReferences;
35-
3613
internal LoopDetector LoopDetector { get; } = new();
3714
/// <summary>
38-
/// Indicates how references in the source document should be handled.
39-
/// </summary>
40-
[Obsolete("Use InlineLocalReference and InlineExternalReference settings instead")]
41-
public ReferenceInlineSetting ReferenceInline
42-
{
43-
get { return referenceInline; }
44-
set
45-
{
46-
referenceInline = value;
47-
switch (referenceInline)
48-
{
49-
case ReferenceInlineSetting.DoNotInlineReferences:
50-
InlineLocalReferences = false;
51-
InlineExternalReferences = false;
52-
break;
53-
case ReferenceInlineSetting.InlineLocalReferences:
54-
InlineLocalReferences = true;
55-
InlineExternalReferences = false;
56-
break;
57-
case ReferenceInlineSetting.InlineAllReferences:
58-
InlineLocalReferences = true;
59-
InlineExternalReferences = true;
60-
break;
61-
}
62-
}
63-
}
64-
/// <summary>
6515
/// Indicates if local references should be rendered as an inline object
6616
/// </summary>
6717
public bool InlineLocalReferences { get; set; }

0 commit comments

Comments
 (0)