Skip to content

Commit fc98f68

Browse files
Use constants instead of immutable static strings to help optimizer and use in switches [ER]. (#4049)
1 parent 13de8d0 commit fc98f68

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/NSwag.Core/OpenApiOperationMethod.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,30 @@ namespace NSwag
1212
public static class OpenApiOperationMethod
1313
{
1414
/// <summary>An undefined method.</summary>
15-
public static string Undefined { get; } = "undefined";
15+
public const string Undefined = "undefined";
1616

1717
/// <summary>The HTTP GET method. </summary>
18-
public static string Get { get; } = "get";
18+
public const string Get = "get";
1919

2020
/// <summary>The HTTP POST method. </summary>
21-
public static string Post { get; } = "post";
21+
public const string Post = "post";
2222

2323
/// <summary>The HTTP PUT method. </summary>
24-
public static string Put { get; } = "put";
24+
public const string Put = "put";
2525

2626
/// <summary>The HTTP DELETE method. </summary>
27-
public static string Delete { get; } = "delete";
27+
public const string Delete = "delete";
2828

2929
/// <summary>The HTTP OPTIONS method. </summary>
30-
public static string Options { get; } = "options";
30+
public const string Options = "options";
3131

3232
/// <summary>The HTTP HEAD method. </summary>
33-
public static string Head { get; } = "head";
33+
public const string Head = "head";
3434

3535
/// <summary>The HTTP PATCH method. </summary>
36-
public static string Patch { get; } = "patch";
36+
public const string Patch = "patch";
3737

3838
/// <summary>The HTTP TRACE method (OpenAPI only). </summary>
39-
public static string Trace { get; } = "trace";
39+
public const string Trace = "trace";
4040
}
4141
}

0 commit comments

Comments
 (0)