Skip to content

Commit d76b951

Browse files
committed
fix(proto): protogen was borked
1 parent a4af327 commit d76b951

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/NativeCodeGen.Core/Export/DatabaseConverter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ private static ExportNative ConvertNative(NativeDefinition native)
9797
ReturnType = native.ReturnType.ToString(),
9898
ReturnDescription = native.ReturnDescription,
9999
Aliases = native.Aliases.Count > 0 ? native.Aliases : null,
100+
UsedEnums = native.UsedEnums.Count > 0 ? native.UsedEnums : null,
100101
RelatedExamples = native.RelatedExamples.Count > 0 ? native.RelatedExamples : null,
101102
ApiSet = native.ApiSet,
102103
Parameters = native.Parameters.Select(ConvertParameter).ToList()

src/NativeCodeGen.Core/Export/ExportModels.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace NativeCodeGen.Core.Export;
1212
/// </summary>
1313

1414
[ProtoContract]
15+
[CompatibilityLevel(CompatibilityLevel.Level240)]
1516
public partial class ExportDatabase
1617
{
1718
[ProtoMember(1)]
@@ -31,6 +32,7 @@ public partial class ExportDatabase
3132
}
3233

3334
[ProtoContract]
35+
[CompatibilityLevel(CompatibilityLevel.Level240)]
3436
public partial class ExportNamespace
3537
{
3638
[ProtoMember(1)]
@@ -41,6 +43,7 @@ public partial class ExportNamespace
4143
}
4244

4345
[ProtoContract]
46+
[CompatibilityLevel(CompatibilityLevel.Level240)]
4447
public partial class ExportNative
4548
{
4649
[ProtoMember(1)]
@@ -70,6 +73,10 @@ public partial class ExportNative
7073
public List<string>? Aliases { get; set; }
7174

7275

76+
[ProtoMember(9)]
77+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
78+
public List<string>? UsedEnums { get; set; }
79+
7380
[ProtoMember(10)]
7481
[JsonPropertyName("apiset")]
7582
public string ApiSet { get; set; } = "client";
@@ -80,6 +87,7 @@ public partial class ExportNative
8087
}
8188

8289
[ProtoContract]
90+
[CompatibilityLevel(CompatibilityLevel.Level240)]
8391
public partial class ExportParameter
8492
{
8593
[ProtoMember(1)]
@@ -101,6 +109,7 @@ public partial class ExportParameter
101109
}
102110

103111
[ProtoContract]
112+
[CompatibilityLevel(CompatibilityLevel.Level240)]
104113
public partial class ExportEnum
105114
{
106115
[ProtoMember(1)]
@@ -119,6 +128,7 @@ public partial class ExportEnum
119128
}
120129

121130
[ProtoContract]
131+
[CompatibilityLevel(CompatibilityLevel.Level240)]
122132
public partial class ExportEnumMember
123133
{
124134
[ProtoMember(1)]
@@ -129,6 +139,7 @@ public partial class ExportEnumMember
129139
}
130140

131141
[ProtoContract]
142+
[CompatibilityLevel(CompatibilityLevel.Level240)]
132143
public partial class ExportStruct
133144
{
134145
[ProtoMember(1)]
@@ -147,6 +158,7 @@ public partial class ExportStruct
147158
}
148159

149160
[ProtoContract]
161+
[CompatibilityLevel(CompatibilityLevel.Level240)]
150162
public partial class ExportStructField
151163
{
152164
[ProtoMember(1)]
@@ -177,6 +189,7 @@ public partial class ExportStructField
177189
}
178190

179191
[ProtoContract]
192+
[CompatibilityLevel(CompatibilityLevel.Level240)]
180193
public partial class ExportSharedExample
181194
{
182195
[ProtoMember(1)]
@@ -191,6 +204,7 @@ public partial class ExportSharedExample
191204
}
192205

193206
[ProtoContract]
207+
[CompatibilityLevel(CompatibilityLevel.Level240)]
194208
public partial class ExportSharedExampleCode
195209
{
196210
[ProtoMember(1)]

src/NativeCodeGen.Core/Export/JsonExporter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class JsonOutput
4444
/// Type information for JSON/Protobuf export.
4545
/// </summary>
4646
[ProtoContract]
47+
[CompatibilityLevel(CompatibilityLevel.Level240)]
4748
public class ExportTypeInfo
4849
{
4950
[ProtoMember(1)]
@@ -78,6 +79,7 @@ public enum ExportTypeCategory
7879
/// Type entry for protobuf serialization (since protobuf doesn't support dictionaries directly).
7980
/// </summary>
8081
[ProtoContract]
82+
[CompatibilityLevel(CompatibilityLevel.Level240)]
8183
public class ExportTypeEntry
8284
{
8385
[ProtoMember(1)]

0 commit comments

Comments
 (0)