Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Conversation

@amoerie
Copy link

@amoerie amoerie commented Apr 25, 2018

  • Maintain a stack of elements that are encountered during traversal of the XML file
  • Detect sibling elements and automatically append indexes to the generated configuration keys, exactly like how the JSON configuration providers does for JSON arrays
  • Add a battery of unit tests to verify no existing features were broken in the process

I know this is a considerable change in the existing code, but all existing tests were not modified and are still green. The "Name" feature is still completely supported and as such, this is not a breaking change.

However, adding a "Name" is no longer required for repeated XML elements, the keys will be automatically populated with indexes instead. This is exactly how the JSON provider handles JSON arrays.

Feedback is most welcome!

Thank you for your consideration.

- Maintain a stack of elements that are encountered during traversal of the XML file
- Detect sibling elements and automatically append indexes to the generated configuration keys, exactly like how the JSON configuration providers does for JSON arrays
- Add a battery of unit tests to verify no existing features were broken in the process
@dnfclas
Copy link

dnfclas commented Apr 25, 2018

CLA assistant check
All CLA requirements met.

- Add a unit test that covers this scenario (previously only functional tests failed)
- Eagerly load the name attribute when an element is encountered, because it is needed for sibling detection.
@amoerie amoerie changed the title Addresses #745 and #815 Support repeated elements in XML configuration, this addresses #745 and #815 Apr 25, 2018
@ajcvickers
Copy link
Contributor

@amoerie After some discussion, we have decided that this would be a good PR to take, since it improves the XML experience with little risk of breaking real-world configs that already exist.

We have recently consolidated the configuration code into the https://github.com/aspnet/Extensions repo. Unfortunately, it is not trivial to move PRs over to another repo, so will not be moving this PR over. However, it should not be too difficult to recreate in the new location if you wish to continue pursuing it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants