Skip to content

Commit 802bbbd

Browse files
DCS alignment to 4.8 with schema support (#71752)
* Fix Private.Xml solution broken by #70706. * Align DCS with 4.8 implementation - minus schema import/export. * External DCS Schema support groundwork. Before DC-tree work and other public APIs. * Added public APIs, but not the DataContract tree yet. * All APIs in. * Cleanup. * Addressed some nits and PR feedback on API. * API nit, more PR feedback. * Fix HasRoot hiding issue. * Add basic schema tests. Fix DataMember bug. * Add /// comments for new schema project. * Fixing bad format in xml comment. * Skip import test on Wasm. * Obsolete old half-coded schema exporter. * Add obsolete attribute in ref project as well. * Removing obsolete for now, since it appears Syndication depends on old class. * Fix the DCJS ref project. * API cleanup. * Project file cleanup * Fix mono issue with reflection access to non-public private fields. * Addressing feedback from API review. * Port NetFx Export/Import test suites to Serializer test projects. * Fix bugs found by newly ported tests. * Account for different newline sizes on different platforms. * Skip flaky test on wasm for now. * Non-draft PR feedback. * Change DC.Members API. Drop KVP shennanigans. * More PR feedback. Co-authored-by: Viktor Hofer <[email protected]>
1 parent bff7c3d commit 802bbbd

File tree

140 files changed

+15028
-2888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+15028
-2888
lines changed

src/libraries/System.Private.DataContractSerialization/src/Resources/Strings.resx

Lines changed: 241 additions & 1 deletion
Large diffs are not rendered by default.

src/libraries/System.Private.DataContractSerialization/src/System.Private.DataContractSerialization.csproj

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
44
<NoWarn>$(NoWarn);1634;1691;649</NoWarn>
@@ -15,11 +15,11 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<Compile Include="$(CommonPath)System\NotImplemented.cs"
19-
Link="Common\System\NotImplemented.cs" />
20-
<Compile Include="$(CommonPath)System\HexConverter.cs"
21-
Link="Common\System\HexConverter.cs" />
18+
<Compile Include="$(CommonPath)System\NotImplemented.cs" Link="Common\System\NotImplemented.cs" />
19+
<Compile Include="$(CommonPath)System\HexConverter.cs" Link="Common\System\HexConverter.cs" />
20+
<Compile Include="$(RuntimeSerializationSources)\AccessorBuilder.cs" />
2221
<Compile Include="$(RuntimeSerializationSources)\Attributes.cs" />
22+
<Compile Include="$(RuntimeSerializationSources)\BitFlagsGenerator.cs" />
2323
<Compile Include="$(RuntimeSerializationSources)\CodeGenerator.cs" />
2424
<Compile Include="$(RuntimeSerializationSources)\ClassDataContract.cs" />
2525
<Compile Include="$(RuntimeSerializationSources)\CollectionDataContract.cs" />
@@ -29,44 +29,56 @@
2929
<Compile Include="$(RuntimeSerializationSources)\DictionaryGlobals.cs" />
3030
<Compile Include="$(RuntimeSerializationSources)\DataContractResolver.cs" />
3131
<Compile Include="$(RuntimeSerializationSources)\DataContractSerializer.cs" />
32+
<Compile Include="$(RuntimeSerializationSources)\DataContractSerializerExtensions.cs" />
3233
<Compile Include="$(RuntimeSerializationSources)\DataContractSerializerSettings.cs" />
34+
<Compile Include="$(RuntimeSerializationSources)\DataContractSet.cs" />
35+
<Compile Include="$(RuntimeSerializationSources)\DataContractSurrogateCaller.cs" />
3336
<Compile Include="$(RuntimeSerializationSources)\DataMember.cs" />
3437
<Compile Include="$(RuntimeSerializationSources)\EnumDataContract.cs" />
38+
<Compile Include="$(RuntimeSerializationSources)\ExportOptions.cs" />
3539
<Compile Include="$(RuntimeSerializationSources)\ExtensionDataObject.cs" />
3640
<Compile Include="$(RuntimeSerializationSources)\ExtensionDataReader.cs" />
3741
<Compile Include="$(RuntimeSerializationSources)\Globals.cs" />
3842
<Compile Include="$(RuntimeSerializationSources)\GenericParameterDataContract.cs" />
3943
<Compile Include="$(RuntimeSerializationSources)\HybridObjectCache.cs" />
40-
<Compile Include="$(RuntimeSerializationSources)\ObjectToIdCache.cs" />
44+
<Compile Include="$(RuntimeSerializationSources)\IExtensibleDataObject.cs" />
45+
<Compile Include="$(RuntimeSerializationSources)\KnownTypeDataContractResolver.cs" />
46+
<Compile Include="$(RuntimeSerializationSources)\MemoryStreamAdapter.cs" />
4147
<Compile Include="$(RuntimeSerializationSources)\ObjectReferenceStack.cs" />
48+
<Compile Include="$(RuntimeSerializationSources)\ObjectToIdCache.cs" />
4249
<Compile Include="$(RuntimeSerializationSources)\PrimitiveDataContract.cs" />
50+
<Compile Include="$(RuntimeSerializationSources)\ReflectionClassWriter.cs" />
51+
<Compile Include="$(RuntimeSerializationSources)\ReflectionReader.cs" />
52+
<Compile Include="$(RuntimeSerializationSources)\ReflectionXmlFormatReader.cs" />
53+
<Compile Include="$(RuntimeSerializationSources)\ReflectionXmlFormatWriter.cs" />
4354
<Compile Include="$(RuntimeSerializationSources)\SchemaExporter.cs" />
55+
<Compile Include="$(RuntimeSerializationSources)\SchemaHelper.cs" />
56+
<Compile Include="$(RuntimeSerializationSources)\SchemaImporter.cs" />
4457
<Compile Include="$(RuntimeSerializationSources)\ScopedKnownTypes.cs" />
58+
<Compile Include="$(RuntimeSerializationSources)\SerializationOption.cs" />
59+
<Compile Include="$(RuntimeSerializationSources)\SpecialTypeDataContract.cs" />
60+
<Compile Include="$(RuntimeSerializationSources)\SurrogateDataContract.cs" />
4561
<Compile Include="$(RuntimeSerializationSources)\XmlDataContract.cs" />
4662
<Compile Include="$(RuntimeSerializationSources)\XmlFormatGeneratorStatics.cs" />
4763
<Compile Include="$(RuntimeSerializationSources)\XmlFormatReaderGenerator.cs" />
4864
<Compile Include="$(RuntimeSerializationSources)\XmlFormatWriterGenerator.cs" />
4965
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializer.cs" />
5066
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerContext.cs" />
51-
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerWriteContext.cs" />
5267
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerReadContext.cs" />
68+
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerReadContextComplex.cs" />
69+
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerWriteContext.cs" />
70+
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerWriteContextComplex.cs" />
5371
<Compile Include="$(RuntimeSerializationSources)\XmlReaderDelegator.cs" />
5472
<Compile Include="$(RuntimeSerializationSources)\XmlSerializableReader.cs" />
73+
<Compile Include="$(RuntimeSerializationSources)\XmlSerializableServices.cs" />
5574
<Compile Include="$(RuntimeSerializationSources)\XmlSerializableWriter.cs" />
5675
<Compile Include="$(RuntimeSerializationSources)\XmlWriterDelegator.cs" />
57-
<Compile Include="$(RuntimeSerializationSources)\SerializationMode.cs" />
58-
<Compile Include="$(RuntimeSerializationSources)\SpecialTypeDataContract.cs" />
59-
<Compile Include="$(RuntimeSerializationSources)\TypeCode.cs" />
60-
<Compile Include="$(RuntimeSerializationSources)\KnownTypeDataContractResolver.cs" />
61-
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerReadContextComplex.cs" />
62-
<Compile Include="$(RuntimeSerializationSources)\XmlObjectSerializerWriteContextComplex.cs" />
63-
<Compile Include="$(RuntimeSerializationSources)\BitFlagsGenerator.cs" />
64-
<Compile Include="$(RuntimeSerializationSources)\DataContractSurrogateCaller.cs" />
65-
<Compile Include="$(RuntimeSerializationSources)\DataContractSerializerExtensions.cs" />
66-
<Compile Include="$(RuntimeSerializationSources)\XmlSerializableServices.cs" />
76+
<Compile Include="$(RuntimeSerializationSources)\XPathQueryGenerator.cs" />
77+
<Compile Include="$(RuntimeSerializationSources)\XsdDataContractExporter.cs" />
6778
<Compile Include="$(XmlSources)\ArrayHelper.cs" />
6879
<Compile Include="$(XmlSources)\BytesWithOffset.cs" />
6980
<Compile Include="$(XmlSources)\XmlDictionaryAsyncCheckWriter.cs" />
81+
<Compile Include="$(XmlSources)\IFragmentCapableXmlDictionaryWriter.cs" />
7082
<Compile Include="$(XmlSources)\IStreamProvider.cs" />
7183
<Compile Include="$(XmlSources)\IXmlDictionary.cs" />
7284
<Compile Include="$(XmlSources)\PrefixHandle.cs" />
@@ -81,6 +93,7 @@
8193
<Compile Include="$(XmlSources)\XmlBinaryWriter.cs" />
8294
<Compile Include="$(XmlSources)\XmlBinaryWriterSession.cs" />
8395
<Compile Include="$(XmlSources)\XmlBufferReader.cs" />
96+
<Compile Include="$(XmlSources)\XmlCanonicalWriter.cs" />
8497
<Compile Include="$(XmlSources)\XmlConverter.cs" />
8598
<Compile Include="$(XmlSources)\XmlDictionary.cs" />
8699
<Compile Include="$(XmlSources)\XmlDictionaryWriter.cs" />
@@ -89,66 +102,50 @@
89102
<Compile Include="$(XmlSources)\XmlDictionaryString.cs" />
90103
<Compile Include="$(XmlSources)\XmlExceptionHelper.cs" />
91104
<Compile Include="$(XmlSources)\XmlNodeWriter.cs" />
105+
<Compile Include="$(XmlSources)\XmlSigningNodeWriter.cs" />
92106
<Compile Include="$(XmlSources)\XmlStreamNodeWriter.cs" />
93107
<Compile Include="$(XmlSources)\XmlUTF8TextReader.cs" />
94108
<Compile Include="$(XmlSources)\XmlUTF8TextWriter.cs" />
95109
<Compile Include="$(XmlSources)\EncodingStreamWrapper.cs" />
96110
<Compile Include="$(TextSources)\Base64Encoding.cs" />
97111
<Compile Include="$(TextSources)\SurrogateChar.cs" />
98112
<Compile Include="$(TextSources)\BinHexEncoding.cs" />
113+
<Compile Include="$(JsonSources)\ByteArrayHelperWithString.cs" />
99114
<Compile Include="$(JsonSources)\DataContractJsonSerializer.cs" />
115+
<Compile Include="$(JsonSources)\DataContractJsonSerializerExtensions.cs" />
116+
<Compile Include="$(JsonSources)\DataContractJsonSerializerSettings.cs" />
117+
<Compile Include="$(JsonSources)\DateTimeFormat.cs" />
118+
<Compile Include="$(JsonSources)\EmitTypeInformation.cs" />
119+
<Compile Include="$(JsonSources)\IXmlJsonReaderInitializer.cs" />
120+
<Compile Include="$(JsonSources)\IXmlJsonWriterInitializer.cs" />
100121
<Compile Include="$(JsonSources)\JsonByteArrayDataContract.cs" />
101122
<Compile Include="$(JsonSources)\JsonClassDataContract.cs" />
102123
<Compile Include="$(JsonSources)\JsonCollectionDataContract.cs" />
103124
<Compile Include="$(JsonSources)\JsonDataContract.cs" />
125+
<Compile Include="$(JsonSources)\JsonEncodingStreamWrapper.cs" />
104126
<Compile Include="$(JsonSources)\JsonEnumDataContract.cs" />
105-
<Compile Include="$(JsonSources)\JsonFormatWriterGenerator.cs" />
127+
<Compile Include="$(JsonSources)\JsonFormatGeneratorStatics.cs" />
106128
<Compile Include="$(JsonSources)\JsonFormatReaderGenerator.cs" />
129+
<Compile Include="$(JsonSources)\JsonFormatWriterGenerator.cs" />
130+
<Compile Include="$(JsonSources)\JsonGlobals.cs" />
131+
<Compile Include="$(JsonSources)\JsonNodeType.cs" />
107132
<Compile Include="$(JsonSources)\JsonObjectDataContract.cs" />
108133
<Compile Include="$(JsonSources)\JsonQNameDataContract.cs" />
109134
<Compile Include="$(JsonSources)\JsonReaderDelegator.cs" />
135+
<Compile Include="$(JsonSources)\JsonReaderWriterFactory.cs" />
110136
<Compile Include="$(JsonSources)\JsonWriterDelegator.cs" />
111137
<Compile Include="$(JsonSources)\JsonStringDataContract.cs" />
112138
<Compile Include="$(JsonSources)\JsonUriDataContract.cs" />
113139
<Compile Include="$(JsonSources)\JsonXmlDataContract.cs" />
114-
<Compile Include="$(JsonSources)\JsonGlobals.cs" />
115-
<Compile Include="$(JsonSources)\XmlObjectSerializerReadContextComplexJson.cs" />
116-
<Compile Include="$(JsonSources)\XmlObjectSerializerWriteContextComplexJson.cs" />
117-
<Compile Include="$(JsonSources)\DateTimeFormat.cs" />
118-
<Compile Include="$(JsonSources)\EmitTypeInformation.cs" />
119-
<Compile Include="$(JsonSources)\DataContractJsonSerializerSettings.cs" />
140+
<Compile Include="$(JsonSources)\ReflectionJsonFormatReader.cs" />
141+
<Compile Include="$(JsonSources)\ReflectionJsonFormatWriter.cs" />
120142
<Compile Include="$(JsonSources)\XmlJsonReader.cs" />
121143
<Compile Include="$(JsonSources)\XmlJsonWriter.cs" />
122-
<Compile Include="$(JsonSources)\JsonReaderWriterFactory.cs" />
123-
<Compile Include="$(JsonSources)\JsonNodeType.cs" />
124-
<Compile Include="$(JsonSources)\IXmlJsonReaderInitializer.cs" />
125-
<Compile Include="$(JsonSources)\IXmlJsonWriterInitializer.cs" />
126-
<Compile Include="$(JsonSources)\ByteArrayHelperWithString.cs" />
127-
<Compile Include="$(JsonSources)\JsonEncodingStreamWrapper.cs" />
128-
<Compile Include="$(JsonSources)\JsonFormatGeneratorStatics.cs" />
129-
<Compile Include="System\Runtime\Serialization\AccessorBuilder.cs" />
144+
<Compile Include="$(JsonSources)\XmlObjectSerializerReadContextComplexJson.cs" />
145+
<Compile Include="$(JsonSources)\XmlObjectSerializerWriteContextComplexJson.cs" />
130146
<Compile Include="$(CommonPath)System\CodeDom\CodeTypeReference.cs" />
131147
<Compile Include="$(CommonPath)System\CodeDom\CodeTypeReferenceCollection.cs" />
132148
<Compile Include="$(CommonPath)System\CodeDom\CodeObject.cs" />
133-
<Compile Include="System\Runtime\Serialization\DataContractSet.cs" />
134-
<Compile Include="System\Runtime\Serialization\ExportOptions.cs" />
135-
<Compile Include="System\Runtime\Serialization\IExtensibleDataObject.cs" />
136-
<Compile Include="System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs" />
137-
<Compile Include="System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs" />
138-
<Compile Include="System\Runtime\Serialization\MemoryStreamAdapter.cs" />
139-
<Compile Include="System\Runtime\Serialization\ReflectionFeature.cs" />
140-
<Compile Include="System\Runtime\Serialization\ReflectionReader.cs" />
141-
<Compile Include="System\Runtime\Serialization\ReflectionClassWriter.cs" />
142-
<Compile Include="System\Runtime\Serialization\ReflectionXmlFormatReader.cs" />
143-
<Compile Include="System\Runtime\Serialization\ReflectionXmlFormatWriter.cs" />
144-
<Compile Include="System\Runtime\Serialization\SchemaHelper.cs" />
145-
<Compile Include="System\Runtime\Serialization\SerializationOption.cs" />
146-
<Compile Include="System\Runtime\Serialization\XPathQueryGenerator.cs" />
147-
<Compile Include="System\Runtime\Serialization\XsdDataContractExporter.cs" />
148-
<Compile Include="System\Runtime\Serialization\SurrogateDataContract.cs" />
149-
<Compile Include="System\Xml\IFragmentCapableXmlDictionaryWriter.cs" />
150-
<Compile Include="System\Xml\XmlCanonicalWriter.cs" />
151-
<Compile Include="System\Xml\XmlSigningNodeWriter.cs" />
152149
</ItemGroup>
153150

154151
<ItemGroup>
@@ -168,6 +165,7 @@
168165
<Reference Include="System.Text.Encoding.Extensions" />
169166
<Reference Include="System.Text.RegularExpressions" />
170167
<Reference Include="System.Threading" />
168+
<Reference Include="System.Threading.Thread" />
171169
<Reference Include="System.Xml.ReaderWriter" />
172170
<Reference Include="System.Xml.XDocument" />
173171
<Reference Include="System.Xml.XmlSerializer" />

src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/AccessorBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Reflection;
99
using System.Runtime.CompilerServices;
1010
using System.Runtime.Serialization;
11+
using System.Runtime.Serialization.DataContracts;
1112
using System.Text;
1213
using System.Threading.Tasks;
1314

0 commit comments

Comments
 (0)