Skip to content

Commit 9989cf1

Browse files
committed
Make static fields readonly
1 parent 2b1613f commit 9989cf1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Microsoft.OpenApi.Readers/V2/OpenApiContactDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal static partial class OpenApiV2Deserializer
3636
},
3737
};
3838

39-
private static PatternFieldMap<OpenApiContact> _contactPatternFields = new PatternFieldMap<OpenApiContact>
39+
private static readonly PatternFieldMap<OpenApiContact> _contactPatternFields = new PatternFieldMap<OpenApiContact>
4040
{
4141
{s => s.StartsWith("x-"), (o, p, n) => o.AddExtension(p, LoadExtension(p, n))}
4242
};

src/Microsoft.OpenApi.Readers/V2/OpenApiInfoDeserializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.OpenApi.Readers.V2
1414
/// </summary>
1515
internal static partial class OpenApiV2Deserializer
1616
{
17-
private static FixedFieldMap<OpenApiInfo> _infoFixedFields = new FixedFieldMap<OpenApiInfo>
17+
private static readonly FixedFieldMap<OpenApiInfo> _infoFixedFields = new FixedFieldMap<OpenApiInfo>
1818
{
1919
{
2020
"title", (o, n) =>
@@ -54,7 +54,7 @@ internal static partial class OpenApiV2Deserializer
5454
}
5555
};
5656

57-
private static PatternFieldMap<OpenApiInfo> _infoPatternFields = new PatternFieldMap<OpenApiInfo>
57+
private static readonly PatternFieldMap<OpenApiInfo> _infoPatternFields = new PatternFieldMap<OpenApiInfo>
5858
{
5959
{s => s.StartsWith("x-"), (o, p, n) => o.AddExtension(p, LoadExtension(p, n))}
6060
};

src/Microsoft.OpenApi.Readers/V2/OpenApiParameterDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Microsoft.OpenApi.Readers.V2
2020
internal static partial class OpenApiV2Deserializer
2121
{
2222
private static JsonSchemaBuilder _parameterJsonSchemaBuilder;
23-
private static FixedFieldMap<OpenApiParameter> _parameterFixedFields =
23+
private static readonly FixedFieldMap<OpenApiParameter> _parameterFixedFields =
2424
new FixedFieldMap<OpenApiParameter>
2525
{
2626
{

0 commit comments

Comments
 (0)