-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for repeated XML elements without a name attribute #44608
Commits on Nov 12, 2020
-
Add support for repeated XML elements without a name attribute
This commit adds support in Microsoft.Extensions.Configuration.Xml for repeated XML elements without requiring a Name attribute. This solves a particularly subtle bug when configuring Serilog from an XML configuration source. For a full description, see dotnet#36541 The original implementation of the XmlStreamConfigurationProvider has been modified to do the following: - Maintain a stack of encountered XML elements while traversing the XML source. This is needed to detect siblings. - When siblings are detected, automatically append an index to the generated configuration keys. This makes it work exactly the same as the JSON configuration provider with JSON arrays. Tests are updated to reflect the new behavior: - Tests that verified an exception occurs when entering duplicate keys have been removed. Duplicate keys are supported now. - Add tests that verify duplicate keys result in the correct configuration keys, with all the lower/upper case variants and with support for the special "Name" attribute handling.
Configuration menu - View commit details
-
Copy full SHA for 01401f0 - Browse repository at this point
Copy the full SHA 01401f0View commit details
Commits on Nov 13, 2020
-
Disable tests for duplicate handling in XML config, they are incompat…
…ible with new implementation
Configuration menu - View commit details
-
Copy full SHA for f83dcfe - Browse repository at this point
Copy the full SHA f83dcfeView commit details -
Stop using the 'Name' parameter to use arrays in XML in the tests, th…
…is is no longer required
Configuration menu - View commit details
-
Copy full SHA for 8de7bda - Browse repository at this point
Copy the full SHA 8de7bdaView commit details
Commits on Dec 17, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 96ea0b9 - Browse repository at this point
Copy the full SHA 96ea0b9View commit details
Commits on Dec 18, 2020
-
Rework the XML configuration provider
The XML configuration provider now builds a simple in-memory model of the XML elements that it encounters Each element keeps track of its attributes, children and content. Furthermore, each element also has a reference to its siblings. Each group of siblings all share the same list. All of the above makes it possible to intelligently produce configuration keys and values, taking into account repeated XML elements.
Configuration menu - View commit details
-
Copy full SHA for ca7097a - Browse repository at this point
Copy the full SHA ca7097aView commit details -
Add test that verifies mixing repeated with non-repeated XML elements…
… works as expected
Configuration menu - View commit details
-
Copy full SHA for c601197 - Browse repository at this point
Copy the full SHA c601197View commit details
Commits on Feb 5, 2021
-
Cleanup nullable annotations in XmlConfigurationElement
Also don't explicitly initialize properties to null
Configuration menu - View commit details
-
Copy full SHA for 3dddfca - Browse repository at this point
Copy the full SHA 3dddfcaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b55a5f - Browse repository at this point
Copy the full SHA 5b55a5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for cd11a03 - Browse repository at this point
Copy the full SHA cd11a03View commit details -
Configuration menu - View commit details
-
Copy full SHA for ff2336f - Browse repository at this point
Copy the full SHA ff2336fView commit details -
Configuration menu - View commit details
-
Copy full SHA for de44ff0 - Browse repository at this point
Copy the full SHA de44ff0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f77e01 - Browse repository at this point
Copy the full SHA 2f77e01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5999c1c - Browse repository at this point
Copy the full SHA 5999c1cView commit details
Commits on Feb 8, 2021
-
Apply suggestions from code review
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 9a1af2a - Browse repository at this point
Copy the full SHA 9a1af2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f07563 - Browse repository at this point
Copy the full SHA 6f07563View commit details -
Add tests related to case insensitivity in XML configuration keys
Verify that a duplicate key exception is thrown when keys are duplicate with different casing Verify that XML siblings are properly detected when the siblings have different casing Verify that values with keys that were originally upper case can be retrieved with their lower case counterparts
Configuration menu - View commit details
-
Copy full SHA for e479aa9 - Browse repository at this point
Copy the full SHA e479aa9View commit details -
Configuration menu - View commit details
-
Copy full SHA for f2e56ee - Browse repository at this point
Copy the full SHA f2e56eeView commit details
Commits on Feb 28, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 8901143 - Browse repository at this point
Copy the full SHA 8901143View commit details
Commits on Mar 1, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 862244e - Browse repository at this point
Copy the full SHA 862244eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 49024de - Browse repository at this point
Copy the full SHA 49024deView commit details
Commits on Mar 10, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 2c2f1b3 - Browse repository at this point
Copy the full SHA 2c2f1b3View commit details -
Rename ProcessAttributes -> ReadAttributes when parsing the XML
This avoids confusion with the ProcessXYZ helper methods that run during a different stage in the algorithm
Configuration menu - View commit details
-
Copy full SHA for 22c02e8 - Browse repository at this point
Copy the full SHA 22c02e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a60973 - Browse repository at this point
Copy the full SHA 5a60973View commit details