Skip to content

Commit aabb15a

Browse files
committed
Update C# snapshots with required attr
1 parent 51313e3 commit aabb15a

File tree

24 files changed

+91
-0
lines changed

24 files changed

+91
-0
lines changed

core/data/tests/anonymous_struct_with_rename/output.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,27 @@
77

88
/** Generated type representing the anonymous struct variant `List` of the `AnonymousStructWithRename` Rust enum */
99
public class AnonymousStructWithRenameListInner {
10+
[JsonProperty(Required = Required.Always)]
1011
public IEnumerable<string> list { get; set; }
1112
}
1213

1314
/** Generated type representing the anonymous struct variant `LongFieldNames` of the `AnonymousStructWithRename` Rust enum */
1415
public class AnonymousStructWithRenameLongFieldNamesInner {
16+
[JsonProperty(Required = Required.Always)]
1517
public string some_long_field_name { get; set; }
18+
[JsonProperty(Required = Required.Always)]
1619
public bool and { get; set; }
20+
[JsonProperty(Required = Required.Always)]
1721
public IEnumerable<string> but_one_more { get; set; }
1822
}
1923

2024
/** Generated type representing the anonymous struct variant `KebabCase` of the `AnonymousStructWithRename` Rust enum */
2125
public class AnonymousStructWithRenameKebabCaseInner {
26+
[JsonProperty(Required = Required.Always)]
2227
public IEnumerable<string> another-list { get; set; }
28+
[JsonProperty(Required = Required.Always)]
2329
public string camelCaseStringField { get; set; }
30+
[JsonProperty(Required = Required.Always)]
2431
public bool something-else { get; set; }
2532
}
2633

core/data/tests/can_apply_prefix_correctly/output.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Runtime.Serialization;
77

88
public class ItemDetailsFieldValue {
9+
[JsonProperty(Required = Required.Always)]
910
public string Hello { get; set; }
1011
}
1112

core/data/tests/can_generate_generic_enum/output.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public record VariantB(TB Content) : GenericEnum<TA, TB>();
1616

1717

1818
public class StructUsingGenericEnum {
19+
[JsonProperty(Required = Required.Always)]
1920
public GenericEnum<string, short> EnumField { get; set; }
2021
}
2122

@@ -33,23 +34,29 @@ public record VariantE(GenericEnum<string, uint> Content) : GenericEnumUsingGene
3334

3435
/** Generated type representing the anonymous struct variant `VariantF` of the `GenericEnumsUsingStructVariants` Rust enum */
3536
public class GenericEnumsUsingStructVariantsVariantFInner<T> {
37+
[JsonProperty(Required = Required.Always)]
3638
public T Action { get; set; }
3739
}
3840

3941
/** Generated type representing the anonymous struct variant `VariantG` of the `GenericEnumsUsingStructVariants` Rust enum */
4042
public class GenericEnumsUsingStructVariantsVariantGInner<T, TU> {
43+
[JsonProperty(Required = Required.Always)]
4144
public T Action { get; set; }
45+
[JsonProperty(Required = Required.Always)]
4246
public TU Response { get; set; }
4347
}
4448

4549
/** Generated type representing the anonymous struct variant `VariantH` of the `GenericEnumsUsingStructVariants` Rust enum */
4650
public class GenericEnumsUsingStructVariantsVariantHInner {
51+
[JsonProperty(Required = Required.Always)]
4752
public int NonGeneric { get; set; }
4853
}
4954

5055
/** Generated type representing the anonymous struct variant `VariantI` of the `GenericEnumsUsingStructVariants` Rust enum */
5156
public class GenericEnumsUsingStructVariantsVariantIInner<T, TU> {
57+
[JsonProperty(Required = Required.Always)]
5258
public IEnumerable<T> Vec { get; set; }
59+
[JsonProperty(Required = Required.Always)]
5360
public MyType<T, TU> Action { get; set; }
5461
}
5562

core/data/tests/can_generate_readonly_fields/output.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Runtime.Serialization;
77

88
public class SomeStruct {
9+
[JsonProperty(Required = Required.Always)]
910
public uint FieldA { get; set; }
1011
}
1112

core/data/tests/can_generate_simple_struct_with_a_comment/output.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ public class Location {
1111
/** This is a comment. */
1212
public class Person {
1313
/** This is another comment */
14+
[JsonProperty(Required = Required.Always)]
1415
public string Name { get; set; }
16+
[JsonProperty(Required = Required.Always)]
1517
public ushort Age { get; set; }
1618
public string? Info { get; set; }
19+
[JsonProperty(Required = Required.Always)]
1720
public IEnumerable<string> Emails { get; set; }
21+
[JsonProperty(Required = Required.Always)]
1822
public Location Location { get; set; }
1923
}
2024

core/data/tests/can_generate_slice_of_user_type/output.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Runtime.Serialization;
77

88
public class Video {
9+
[JsonProperty(Required = Required.Always)]
910
public IEnumerable<Tag> Tags { get; set; }
1011
}
1112

core/data/tests/can_generate_struct_with_skipped_fields/output.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
using System.Runtime.Serialization;
77

88
public class MyStruct {
9+
[JsonProperty(Required = Required.Always)]
910
public int A { get; set; }
11+
[JsonProperty(Required = Required.Always)]
1012
public int C { get; set; }
1113
}
1214

core/data/tests/can_handle_anonymous_struct/output.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
/** Generated type representing the anonymous struct variant `Us` of the `AutofilledBy` Rust enum */
99
public class AutofilledByUsInner {
1010
/** The UUID for the fill */
11+
[JsonProperty(Required = Required.Always)]
1112
public string Uuid { get; set; }
1213
}
1314

1415
/** Generated type representing the anonymous struct variant `SomethingElse` of the `AutofilledBy` Rust enum */
1516
public class AutofilledBySomethingElseInner {
1617
/** The UUID for the fill */
18+
[JsonProperty(Required = Required.Always)]
1719
public string Uuid { get; set; }
1820
/** Some other thing */
21+
[JsonProperty(Required = Required.Always)]
1922
public int Thing { get; set; }
2023
}
2124

@@ -34,12 +37,15 @@ public record SomethingElse(AutofilledBySomethingElseInner Content): AutofilledB
3437

3538
/** Generated type representing the anonymous struct variant `AnonVariant` of the `EnumWithManyVariants` Rust enum */
3639
public class EnumWithManyVariantsAnonVariantInner {
40+
[JsonProperty(Required = Required.Always)]
3741
public string Uuid { get; set; }
3842
}
3943

4044
/** Generated type representing the anonymous struct variant `AnotherAnonVariant` of the `EnumWithManyVariants` Rust enum */
4145
public class EnumWithManyVariantsAnotherAnonVariantInner {
46+
[JsonProperty(Required = Required.Always)]
4247
public string Uuid { get; set; }
48+
[JsonProperty(Required = Required.Always)]
4349
public int Thing { get; set; }
4450
}
4551

core/data/tests/can_handle_serde_rename/output.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ public class OtherType {
1010

1111
/** This is a comment. */
1212
public class Person {
13+
[JsonProperty(Required = Required.Always)]
1314
public string name { get; set; }
15+
[JsonProperty(Required = Required.Always)]
1416
public ushort age { get; set; }
17+
[JsonProperty(Required = Required.Always)]
1518
public int extraSpecialFieldOne { get; set; }
1619
public IEnumerable<string>? extraSpecialFieldTwo { get; set; }
20+
[JsonProperty(Required = Required.Always)]
1721
public OtherType nonStandardDataType { get; set; }
1822
public IEnumerable<OtherType>? nonStandardDataTypeInArray { get; set; }
1923
}

core/data/tests/can_handle_serde_rename_all/output.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@
77

88
/** This is a Person struct with camelCase rename */
99
public class Person {
10+
[JsonProperty(Required = Required.Always)]
1011
public string firstName { get; set; }
12+
[JsonProperty(Required = Required.Always)]
1113
public string lastName { get; set; }
14+
[JsonProperty(Required = Required.Always)]
1215
public ushort age { get; set; }
16+
[JsonProperty(Required = Required.Always)]
1317
public int extraSpecialField1 { get; set; }
1418
public IEnumerable<string>? extraSpecialField2 { get; set; }
1519
}
1620

1721
/** This is a Person2 struct with UPPERCASE rename */
1822
public class Person2 {
23+
[JsonProperty(Required = Required.Always)]
1924
public string FIRST_NAME { get; set; }
25+
[JsonProperty(Required = Required.Always)]
2026
public string LAST_NAME { get; set; }
27+
[JsonProperty(Required = Required.Always)]
2128
public ushort AGE { get; set; }
2229
}
2330

0 commit comments

Comments
 (0)