Skip to content

Conversation

beatt83
Copy link

@beatt83 beatt83 commented Nov 22, 2024

Hi there.

To contribute I added this option that I found to be useful so before encoding the encoder first sorts the keys. I found a similar logic was already being used for Map<CBOREncodable, Any> so I added the option so maps are sorted by key.

So it doesn't cause any breaking change this flag is set to true by default.

@obinns-dd
Copy link

@hamchapman any chance we can look to get this one merged?

It looks like it solves #104 and it's would help a lot of folks (including myself).

Also related to but not exactly solving the issue of OrderedDictionary: #96.

@beatt83
Copy link
Author

beatt83 commented Aug 29, 2025

@obinns-dd I had forgotten that I created this PR, since it is almost close to a year now. I can probably update my fork repo and create a release version, so it can be used by others.

so it does not introduce breaking changes this flag is set as default to true

Signed-off-by: Goncalo Frade <goncalofrade08@gmail.com>
@beatt83 beatt83 force-pushed the feature/add_map_sort_option branch from fca4773 to c634481 Compare August 29, 2025 13:13
@beatt83
Copy link
Author

beatt83 commented Aug 29, 2025

@obinns-dd here you go. Its updated with last changes and it has the sort order, I know not ideal but its the best I can do to help: https://github.com/beatt83/SwiftCBOR/releases/tag/0.5.1

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