Skip to content

Conversation

@Thodor12
Copy link

Add a new option called xmlSortAttributesFirst, this allows to sort attributes in a fixed way.
For example if I were to have an id field on my XML and I always want this attribute to be sorted first, I can put xmlSortAttributesFirst: ["id"] to force this property to come first.

The attributes in this list are sorted in the order they are listed, even if certain are not present.

I've added 2 tests to ensure the functionality works as intended.

@kddnewton
Copy link
Member

Hi @Thodor12 — thanks for the contribution, but I think this is one of those features we will be opinionated about and not support.

@kddnewton kddnewton closed this Jul 8, 2025
@Thodor12 Thodor12 deleted the feature/extended_sorting branch August 10, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants