Skip to content

Commit a28aa21

Browse files
committed
chore: replace interface with concrete type
1 parent c035940 commit a28aa21

File tree

72 files changed

+355
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+355
-355
lines changed

src/Microsoft.OpenApi.Hidi/Extensions/OpenApiExtensibleExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal static class OpenApiExtensibleExtensions
1313
/// <param name="extensions">A dictionary of <see cref="IOpenApiExtension"/>.</param>
1414
/// <param name="extensionKey">The key corresponding to the <see cref="IOpenApiExtension"/>.</param>
1515
/// <returns>A <see cref="string"/> value matching the provided extensionKey. Return null when extensionKey is not found. </returns>
16-
internal static string GetExtension(this IDictionary<string, IOpenApiExtension> extensions, string extensionKey)
16+
internal static string GetExtension(this Dictionary<string, IOpenApiExtension> extensions, string extensionKey)
1717
{
1818
if (extensions.TryGetValue(extensionKey, out var value) && value is OpenApiAny { Node: JsonValue castValue } && castValue.TryGetValue<string>(out var stringValue))
1919
{

src/Microsoft.OpenApi.Hidi/Formatters/PowerShellFormatter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private static string RemoveKeyTypeSegment(string operationId, IList<IOpenApiPar
161161

162162
private static void ResolveFunctionParameters(IList<IOpenApiParameter> parameters)
163163
{
164-
foreach (var parameter in parameters.OfType<OpenApiParameter>().Where(static p => p.Content?.Any() ?? false))
164+
foreach (var parameter in parameters.OfType<OpenApiParameter>().Where(static p => p.Content?.Count > 0))
165165
{
166166
// Replace content with a schema object of type array
167167
// for structured or collection-valued function parameters

src/Microsoft.OpenApi.Hidi/StatsVisitor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override void Visit(IOpenApiSchema schema)
2727

2828
public int HeaderCount { get; set; }
2929

30-
public override void Visit(IDictionary<string, IOpenApiHeader> headers)
30+
public override void Visit(Dictionary<string, IOpenApiHeader> headers)
3131
{
3232
HeaderCount++;
3333
}

src/Microsoft.OpenApi.Workbench/StatsVisitor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override void Visit(IOpenApiSchema schema)
2727

2828
public int HeaderCount { get; set; }
2929

30-
public override void Visit(IDictionary<string, IOpenApiHeader> headers)
30+
public override void Visit(Dictionary<string, IOpenApiHeader> headers)
3131
{
3232
HeaderCount++;
3333
}

src/Microsoft.OpenApi/Extensions/OpenApiServerExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static class OpenApiServerExtensions
2121
/// 1. A substitution has no valid value in both the supplied dictionary and the default
2222
/// 2. A substitution's value is not available in the enum provided
2323
/// </exception>
24-
public static string? ReplaceServerUrlVariables(this OpenApiServer server, IDictionary<string, string>? values = null)
24+
public static string? ReplaceServerUrlVariables(this OpenApiServer server, Dictionary<string, string>? values = null)
2525
{
2626
var parsedUrl = server.Url;
2727
if (server.Variables is not null && parsedUrl is not null)

src/Microsoft.OpenApi/Interfaces/IMetadataContainer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public interface IMetadataContainer
1414
/// <summary>
1515
/// A collection of properties associated with the current OpenAPI element.
1616
/// </summary>
17-
IDictionary<string, object>? Metadata { get; set; }
17+
Dictionary<string, object>? Metadata { get; set; }
1818
}
1919
}

src/Microsoft.OpenApi/Interfaces/IOpenApiExtensible.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public interface IOpenApiExtensible : IOpenApiElement
1313
/// <summary>
1414
/// Specification extensions.
1515
/// </summary>
16-
IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
16+
Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
1717
}
1818
}

src/Microsoft.OpenApi/Interfaces/IOpenApiReadOnlyExtensible.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public interface IOpenApiReadOnlyExtensible
1010
/// <summary>
1111
/// Specification extensions.
1212
/// </summary>
13-
IDictionary<string, IOpenApiExtension>? Extensions { get; }
13+
Dictionary<string, IOpenApiExtension>? Extensions { get; }
1414

1515
}

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiHeader.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public interface IOpenApiHeader : IOpenApiDescribedElement, IOpenApiReadOnlyExte
5555
/// <summary>
5656
/// Examples of the media type.
5757
/// </summary>
58-
public IDictionary<string, IOpenApiExample>? Examples { get; }
58+
public Dictionary<string, IOpenApiExample>? Examples { get; }
5959

6060
/// <summary>
6161
/// A map containing the representations for the header.
6262
/// </summary>
63-
public IDictionary<string, OpenApiMediaType>? Content { get; }
63+
public Dictionary<string, OpenApiMediaType>? Content { get; }
6464

6565
}

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiLink.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public interface IOpenApiLink : IOpenApiDescribedElement, IOpenApiReadOnlyExtens
2424
/// <summary>
2525
/// A map representing parameters to pass to an operation as specified with operationId or identified via operationRef.
2626
/// </summary>
27-
public IDictionary<string, RuntimeExpressionAnyWrapper>? Parameters { get; }
27+
public Dictionary<string, RuntimeExpressionAnyWrapper>? Parameters { get; }
2828

2929
/// <summary>
3030
/// A literal value or {expression} to use as a request body when calling the target operation.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiParameter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public interface IOpenApiParameter : IOpenApiDescribedElement, IOpenApiReadOnlyE
8181
/// Furthermore, if referencing a schema which contains an example,
8282
/// the examples value SHALL override the example provided by the schema.
8383
/// </summary>
84-
public IDictionary<string, IOpenApiExample>? Examples { get; }
84+
public Dictionary<string, IOpenApiExample>? Examples { get; }
8585

8686
/// <summary>
8787
/// Example of the media type. The example SHOULD match the specified schema and encoding properties
@@ -102,5 +102,5 @@ public interface IOpenApiParameter : IOpenApiDescribedElement, IOpenApiReadOnlyE
102102
/// When example or examples are provided in conjunction with the schema object,
103103
/// the example MUST follow the prescribed serialization strategy for the parameter.
104104
/// </summary>
105-
public IDictionary<string, OpenApiMediaType>? Content { get; }
105+
public Dictionary<string, OpenApiMediaType>? Content { get; }
106106
}

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiPathItem.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface IOpenApiPathItem : IOpenApiDescribedElement, IOpenApiSummarized
1414
/// <summary>
1515
/// Gets the definition of operations on this path.
1616
/// </summary>
17-
public IDictionary<HttpMethod, OpenApiOperation>? Operations { get; }
17+
public Dictionary<HttpMethod, OpenApiOperation>? Operations { get; }
1818

1919
/// <summary>
2020
/// An alternative server array to service all operations in this path.

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiRequestBody.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IOpenApiRequestBody : IOpenApiDescribedElement, IOpenApiReadOnl
1919
/// REQUIRED. The content of the request body. The key is a media type or media type range and the value describes it.
2020
/// For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
2121
/// </summary>
22-
public IDictionary<string, OpenApiMediaType>? Content { get; }
22+
public Dictionary<string, OpenApiMediaType>? Content { get; }
2323
/// <summary>
2424
/// Converts the request body to a body parameter in preparation for a v2 serialization.
2525
/// </summary>

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiResponse.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ public interface IOpenApiResponse : IOpenApiDescribedElement, IOpenApiReadOnlyEx
1212
/// <summary>
1313
/// Maps a header name to its definition.
1414
/// </summary>
15-
public IDictionary<string, IOpenApiHeader>? Headers { get; }
15+
public Dictionary<string, IOpenApiHeader>? Headers { get; }
1616

1717
/// <summary>
1818
/// A map containing descriptions of potential response payloads.
1919
/// The key is a media type or media type range and the value describes it.
2020
/// </summary>
21-
public IDictionary<string, OpenApiMediaType>? Content { get; }
21+
public Dictionary<string, OpenApiMediaType>? Content { get; }
2222

2323
/// <summary>
2424
/// A map of operations links that can be followed from the response.
2525
/// The key of the map is a short name for the link,
2626
/// following the naming constraints of the names for Component Objects.
2727
/// </summary>
28-
public IDictionary<string, IOpenApiLink>? Links { get; }
28+
public Dictionary<string, IOpenApiLink>? Links { get; }
2929
}

src/Microsoft.OpenApi/Models/Interfaces/IOpenApiSchema.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiReadOnlyExte
3535
/// <summary>
3636
/// $vocabulary- used in meta-schemas to identify the vocabularies available for use in schemas described by that meta-schema.
3737
/// </summary>
38-
public IDictionary<string, bool>? Vocabulary { get; }
38+
public Dictionary<string, bool>? Vocabulary { get; }
3939

4040
/// <summary>
4141
/// $dynamicRef - an applicator that allows for deferring the full resolution until runtime, at which point it is resolved each time it is encountered while evaluating an instance
@@ -51,7 +51,7 @@ public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiReadOnlyExte
5151
/// $defs - reserves a location for schema authors to inline re-usable JSON Schemas into a more general schema.
5252
/// The keyword does not directly affect the validation result
5353
/// </summary>
54-
public IDictionary<string, IOpenApiSchema>? Definitions { get; }
54+
public Dictionary<string, IOpenApiSchema>? Definitions { get; }
5555

5656
/// <summary>
5757
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
@@ -195,7 +195,7 @@ public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiReadOnlyExte
195195
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
196196
/// Property definitions MUST be a Schema Object and not a standard JSON Schema (inline or referenced).
197197
/// </summary>
198-
public IDictionary<string, IOpenApiSchema>? Properties { get; }
198+
public Dictionary<string, IOpenApiSchema>? Properties { get; }
199199

200200
/// <summary>
201201
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
@@ -204,7 +204,7 @@ public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiReadOnlyExte
204204
/// egular expression dialect. Each property value of this object MUST be an object, and each object MUST
205205
/// be a valid Schema Object not a standard JSON Schema.
206206
/// </summary>
207-
public IDictionary<string, IOpenApiSchema>? PatternProperties { get; }
207+
public Dictionary<string, IOpenApiSchema>? PatternProperties { get; }
208208

209209
/// <summary>
210210
/// Follow JSON Schema definition: https://tools.ietf.org/html/draft-fge-json-schema-validation-00
@@ -278,16 +278,16 @@ public interface IOpenApiSchema : IOpenApiDescribedElement, IOpenApiReadOnlyExte
278278
/// <summary>
279279
/// This object stores any unrecognized keywords found in the schema.
280280
/// </summary>
281-
public IDictionary<string, JsonNode>? UnrecognizedKeywords { get; }
281+
public Dictionary<string, JsonNode>? UnrecognizedKeywords { get; }
282282

283283
/// <summary>
284284
/// Any annotation to attach to the schema to be used by the application.
285285
/// Annotations are NOT (de)serialized with the schema and can be used for custom properties.
286286
/// </summary>
287-
public IDictionary<string, object>? Annotations { get; }
287+
public Dictionary<string, object>? Annotations { get; }
288288

289289
/// <summary>
290290
/// Follow JSON Schema definition:https://json-schema.org/draft/2020-12/json-schema-validation#section-6.5.4
291291
/// </summary>
292-
public IDictionary<string, ISet<string>>? DependentRequired { get; }
292+
public Dictionary<string, ISet<string>>? DependentRequired { get; }
293293
}

src/Microsoft.OpenApi/Models/OpenApiCallback.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class OpenApiCallback : IOpenApiExtensible, IOpenApiCallback
2222
/// <summary>
2323
/// This object MAY be extended with Specification Extensions.
2424
/// </summary>
25-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
25+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
2626

2727
/// <summary>
2828
/// Parameter-less constructor

src/Microsoft.OpenApi/Models/OpenApiComponents.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,57 +19,57 @@ public class OpenApiComponents : IOpenApiSerializable, IOpenApiExtensible
1919
/// <summary>
2020
/// An object to hold reusable <see cref="IOpenApiSchema"/> Objects.
2121
/// </summary>
22-
public IDictionary<string, IOpenApiSchema>? Schemas { get; set; }
22+
public Dictionary<string, IOpenApiSchema>? Schemas { get; set; }
2323

2424
/// <summary>
2525
/// An object to hold reusable <see cref="IOpenApiResponse"/> Objects.
2626
/// </summary>
27-
public IDictionary<string, IOpenApiResponse>? Responses { get; set; }
27+
public Dictionary<string, IOpenApiResponse>? Responses { get; set; }
2828

2929
/// <summary>
3030
/// An object to hold reusable <see cref="IOpenApiParameter"/> Objects.
3131
/// </summary>
32-
public IDictionary<string, IOpenApiParameter>? Parameters { get; set; }
32+
public Dictionary<string, IOpenApiParameter>? Parameters { get; set; }
3333

3434
/// <summary>
3535
/// An object to hold reusable <see cref="OpenApiExample"/> Objects.
3636
/// </summary>
37-
public IDictionary<string, IOpenApiExample>? Examples { get; set; }
37+
public Dictionary<string, IOpenApiExample>? Examples { get; set; }
3838

3939
/// <summary>
4040
/// An object to hold reusable <see cref="IOpenApiRequestBody"/> Objects.
4141
/// </summary>
42-
public IDictionary<string, IOpenApiRequestBody>? RequestBodies { get; set; }
42+
public Dictionary<string, IOpenApiRequestBody>? RequestBodies { get; set; }
4343

4444
/// <summary>
4545
/// An object to hold reusable <see cref="IOpenApiHeader"/> Objects.
4646
/// </summary>
47-
public IDictionary<string, IOpenApiHeader>? Headers { get; set; }
47+
public Dictionary<string, IOpenApiHeader>? Headers { get; set; }
4848

4949
/// <summary>
5050
/// An object to hold reusable <see cref="IOpenApiSecurityScheme"/> Objects.
5151
/// </summary>
52-
public IDictionary<string, IOpenApiSecurityScheme>? SecuritySchemes { get; set; }
52+
public Dictionary<string, IOpenApiSecurityScheme>? SecuritySchemes { get; set; }
5353

5454
/// <summary>
5555
/// An object to hold reusable <see cref="IOpenApiLink"/> Objects.
5656
/// </summary>
57-
public IDictionary<string, IOpenApiLink>? Links { get; set; }
57+
public Dictionary<string, IOpenApiLink>? Links { get; set; }
5858

5959
/// <summary>
6060
/// An object to hold reusable <see cref="OpenApiCallback"/> Objects.
6161
/// </summary>
62-
public IDictionary<string, IOpenApiCallback>? Callbacks { get; set; }
62+
public Dictionary<string, IOpenApiCallback>? Callbacks { get; set; }
6363

6464
/// <summary>
6565
/// An object to hold reusable <see cref="IOpenApiPathItem"/> Object.
6666
/// </summary>
67-
public IDictionary<string, IOpenApiPathItem>? PathItems { get; set; }
67+
public Dictionary<string, IOpenApiPathItem>? PathItems { get; set; }
6868

6969
/// <summary>
7070
/// This object MAY be extended with Specification Extensions.
7171
/// </summary>
72-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
72+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
7373

7474
/// <summary>
7575
/// Parameter-less constructor

src/Microsoft.OpenApi/Models/OpenApiContact.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class OpenApiContact : IOpenApiSerializable, IOpenApiExtensible
3232
/// <summary>
3333
/// This object MAY be extended with Specification Extensions.
3434
/// </summary>
35-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
35+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
3636

3737
/// <summary>
3838
/// Parameter-less constructor

src/Microsoft.OpenApi/Models/OpenApiDiscriminator.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public class OpenApiDiscriminator : IOpenApiSerializable, IOpenApiExtensible
2121
/// <summary>
2222
/// An object to hold mappings between payload values and schema names or references.
2323
/// </summary>
24-
public IDictionary<string, OpenApiSchemaReference>? Mapping { get; set; }
24+
public Dictionary<string, OpenApiSchemaReference>? Mapping { get; set; }
2525

2626
/// <summary>
2727
/// This object MAY be extended with Specification Extensions.
2828
/// </summary>
29-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
29+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
3030

3131
/// <summary>
3232
/// Parameter-less constructor

src/Microsoft.OpenApi/Models/OpenApiDocument.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void RegisterComponents()
6161
/// A map of requests initiated other than by an API call, for example by an out of band registration.
6262
/// The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses
6363
/// </summary>
64-
public IDictionary<string, IOpenApiPathItem>? Webhooks { get; set; }
64+
public Dictionary<string, IOpenApiPathItem>? Webhooks { get; set; }
6565

6666
/// <summary>
6767
/// An element to hold various schemas for the specification.
@@ -103,10 +103,10 @@ public ISet<OpenApiTag>? Tags
103103
/// <summary>
104104
/// This object MAY be extended with Specification Extensions.
105105
/// </summary>
106-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
106+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
107107

108108
/// <inheritdoc />
109-
public IDictionary<string, object>? Metadata { get; set; }
109+
public Dictionary<string, object>? Metadata { get; set; }
110110

111111
/// <summary>
112112
/// Implements IBaseDocument

src/Microsoft.OpenApi/Models/OpenApiEncoding.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class OpenApiEncoding : IOpenApiSerializable, IOpenApiExtensible
2525
/// <summary>
2626
/// A map allowing additional information to be provided as headers.
2727
/// </summary>
28-
public IDictionary<string, IOpenApiHeader>? Headers { get; set; }
28+
public Dictionary<string, IOpenApiHeader>? Headers { get; set; }
2929

3030
/// <summary>
3131
/// Describes how a specific property value will be serialized depending on its type.
@@ -52,7 +52,7 @@ public class OpenApiEncoding : IOpenApiSerializable, IOpenApiExtensible
5252
/// <summary>
5353
/// This object MAY be extended with Specification Extensions.
5454
/// </summary>
55-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
55+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
5656

5757
/// <summary>
5858
/// Parameter-less constructor

src/Microsoft.OpenApi/Models/OpenApiExample.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class OpenApiExample : IOpenApiExtensible, IOpenApiExample
2828
public JsonNode? Value { get; set; }
2929

3030
/// <inheritdoc/>
31-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
31+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
3232

3333
/// <summary>
3434
/// Parameter-less constructor

src/Microsoft.OpenApi/Models/OpenApiExtensibleDictionary.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ protected OpenApiExtensibleDictionary():this([]) { }
2828
/// <param name="extensions">The dictionary of <see cref="IOpenApiExtension"/>.</param>
2929
protected OpenApiExtensibleDictionary(
3030
Dictionary<string, T> dictionary,
31-
IDictionary<string, IOpenApiExtension>? extensions = null) : base(dictionary is null ? [] : dictionary)
31+
Dictionary<string, IOpenApiExtension>? extensions = null) : base(dictionary is null ? [] : dictionary)
3232
{
3333
Extensions = extensions != null ? new Dictionary<string, IOpenApiExtension>(extensions) : [];
3434
}
3535

3636
/// <summary>
3737
/// This object MAY be extended with Specification Extensions.
3838
/// </summary>
39-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
39+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
4040

4141

4242
/// <summary>

src/Microsoft.OpenApi/Models/OpenApiExternalDocs.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class OpenApiExternalDocs : IOpenApiSerializable, IOpenApiExtensible
2626
/// <summary>
2727
/// This object MAY be extended with Specification Extensions.
2828
/// </summary>
29-
public IDictionary<string, IOpenApiExtension>? Extensions { get; set; }
29+
public Dictionary<string, IOpenApiExtension>? Extensions { get; set; }
3030

3131
/// <summary>
3232
/// Parameter-less constructor

0 commit comments

Comments
 (0)