Skip to content

Commit 0eb40e4

Browse files
committed
fix casing
1 parent 10c702f commit 0eb40e4

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

sampleapps/NativeAotAnnotations/AppJsonContext.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,14 @@ namespace NativeAotAnnotations;
88

99
[JsonSerializable(typeof(PromptRequest))]
1010
[JsonSerializable(typeof(AppInfoResponse))]
11+
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
1112
internal partial class AppJsonContext : JsonSerializerContext;
1213

1314
internal record AppInfoResponse
1415
{
15-
[JsonPropertyName("appName")]
1616
public string AppName { get; init; } = "";
17-
18-
[JsonPropertyName("isNativeAot")]
1917
public bool IsNativeAot { get; init; }
20-
21-
[JsonPropertyName("framework")]
2218
public string Framework { get; init; } = "";
23-
24-
[JsonPropertyName("architecture")]
2519
public string Architecture { get; init; } = "";
26-
27-
[JsonPropertyName("os")]
2820
public string Os { get; init; } = "";
2921
}

sampleapps/NativeAotExtensions/Program.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,14 @@ static string GetAppInfo()
6060

6161
[JsonSerializable(typeof(PromptRequest))]
6262
[JsonSerializable(typeof(AppInfoResponse))]
63+
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
6364
internal partial class AppJsonContext : JsonSerializerContext;
6465

6566
internal record AppInfoResponse
6667
{
67-
[JsonPropertyName("appName")]
6868
public string AppName { get; init; } = "";
69-
70-
[JsonPropertyName("isNativeAot")]
7169
public bool IsNativeAot { get; init; }
72-
73-
[JsonPropertyName("framework")]
7470
public string Framework { get; init; } = "";
75-
76-
[JsonPropertyName("architecture")]
7771
public string Architecture { get; init; } = "";
78-
79-
[JsonPropertyName("os")]
8072
public string Os { get; init; } = "";
8173
}

0 commit comments

Comments
 (0)