Commit 936d073
authored
feat(common): support null value for reference type collection elements (#3163)
- update `SerializationBuilder` to set `ValueSerialization.IsNullable : true` for reference type collection elements
- that will add null value handling in deserialization logic for collection elements of reference type
- generate null check in generated serialization/deserialization codes for:
- nullable value type
- list/dictionary types
- some framework reference types
- optimize null value processing so that we don't generate null check codes
- for custom model types, put null value processing logic into the deserialization method of each model
- for string, use default serialization/deserialization methods which can handle null value
- update `byte[]` serializatoin/deserialization methods so that they can handle null value, so that we don't generate null check codes externally
- fix 3 test cases previously do not accept null value in collections in response, now we align with other language implementaion on that
resolve #31591 parent ec012c6 commit 936d073
File tree
1,363 files changed
+6085
-256
lines changed- samples
- AnomalyDetector/Generated/Models
- AppConfiguration/Generated/Models
- Azure.AI.FormRecognizer/Generated/Models
- Azure.Management.Storage/Generated/Models
- Azure.Network.Management.Interface/Generated/Models
- Azure.ResourceManager.Sample/Generated/Models
- Azure.Storage.Tables/Generated
- Models
- CognitiveSearch/Generated/Models
- CognitiveServices.TextAnalytics/Generated/Models
- src
- AutoRest.CSharp/Common
- Generation/Writers
- Output
- Builders
- Models/Types
- test
- AutoRest.TestServer.Tests
- AutoRest.TestServerLowLevel.Tests
- CadlRanchProjects
- arrays/item-types/Generated
- Models
- authentication
- api-key/Generated/Models
- oauth2/Generated/Models
- inheritance/Generated/Models
- models
- property-optional/Generated/Models
- property-types/Generated/Models
- usage/Generated/Models
- TestProjects
- AdditionalPropertiesEx/Generated/Models
- ApiVersion-Cadl/Generated/Models
- Authoring-Cadl/Generated/Models
- Customizations-Cadl/Generated/Models
- ExactMatchFlattenInheritance/Generated/Models
- ExactMatchInheritance/Generated/Models
- ExtensionClientName/Generated/Models
- FirstTest-Cadl/Generated/Models
- Inheritance/Generated/Models
- Lro-Basic-Cadl/Generated/Models
- MgmtCollectionParent/Generated/Models
- MgmtDiscriminator/Generated/Models
- MgmtExpandResourceTypes/Generated/Models
- MgmtExtensionCommonRestOperation/Generated/Models
- MgmtExtensionResource/Generated/Models
- MgmtHierarchicalNonResource/Generated/Models
- MgmtLRO/Generated/Models
- MgmtListMethods/Generated/Models
- MgmtMockAndSample/src/Generated/Models
- MgmtMultipleParentResource/Generated/Models
- MgmtNonStringPathVariable/Generated/Models
- MgmtOperations/Generated/Models
- MgmtOptionalConstant/Generated/Models
- MgmtParamOrdering/Generated/Models
- MgmtParent/Generated/Models
- MgmtPropertyBag/Generated/Models
- MgmtPropertyChooser/Generated/Models
- MgmtRenameRules/Generated/Models
- MgmtResourceName/Generated/Models
- MgmtSafeFlatten/Generated/Models
- MgmtScopeResource/Generated/Models
- MgmtSingletonResource/Generated/Models
- MgmtSubscriptionNameParameter/Generated/Models
- ModelShapes/Generated/Models
- ModelWithConverterUsage/Generated/Models
- Models-Cadl/Generated/Models
- NameConflicts/Generated/Models
- NoTypeReplacement/Generated/Models
- OmitOperationGroups/Generated/Models
- Pagination-Cadl/Generated/Models
- Pagination/Generated/Models
- Parameters-Cadl/Generated/Models
- PetStore-Cadl/Generated/Models
- ProtocolMethodsInRestClient/Generated/Models
- ReferenceTypes/Generated/Models
- ResourceRename/Generated/Models
- SubscriptionExtensions/Generated/Models
- SupersetFlattenInheritance/Generated/Models
- SupersetInheritance/Generated/Models
- TenantOnly/Generated/Models
- TypeSchemaMapping/SomeFolder/Generated/Models
- XmlDeserialization/Generated/Models
- TestServerProjects
- additionalProperties/Generated/Models
- azure-parameter-grouping/Generated/Models
- azure-special-properties/Generated/Models
- body-array/Generated
- Models
- body-boolean/Generated/Models
- body-byte/Generated/Models
- body-complex/Generated/Models
- body-datetime-rfc1123/Generated/Models
- body-datetime/Generated/Models
- body-date/Generated/Models
- body-dictionary/Generated
- Models
- body-duration/Generated/Models
- body-file/Generated/Models
- body-formdata/Generated/Models
- body-integer/Generated/Models
- body-number/Generated/Models
- body-string/Generated/Models
- body-time/Generated/Models
- custom-baseUrl-more-options/Generated/Models
- custom-baseUrl-paging/Generated/Models
- custom-baseUrl/Generated/Models
- extensible-enums-swagger/Generated/Models
- header/Generated/Models
- httpInfrastructure/Generated/Models
- lro-parameterized-endpoints/Generated/Models
- lro/Generated/Models
- model-flattening/Generated/Models
- multiple-inheritance/Generated/Models
- paging/Generated/Models
- required-optional/Generated/Models
- subscriptionId-apiVersion/Generated/Models
- url-multi-collectionFormat/Generated/Models
- url/Generated/Models
- validation/Generated/Models
- xml-service/Generated/Models
- xms-error-responses/Generated/Models
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
1,363 files changed
+6085
-256
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
0 commit comments