django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

fix: MultipleChoiceField use ordered sort

Open fbozhang opened this issue 7 months ago • 3 comments

This modification has the following advantages:

  1. Maintain the input order.
  2. Prevent the output from being a set, which would cause issues with JSON serialization (e.g., when passing parameters to certain third-party SDKs that may internally use json.dumps, and I cannot modify the third party's encoder).

fbozhang avatar Jul 05 '25 07:07 fbozhang

please also add unit tests to verify this and make the CI green

I’ve added the tests and the CI is green now.

fbozhang avatar Jul 05 '25 09:07 fbozhang

Seems sensible to me 👍🏻

However, it will have to wait for 3.17 as I see this as potentially disruptive for some downstream users. Left a small suggestion

Good point — waiting for 3.17 sounds like the right call. Appreciate the suggestion!

fbozhang avatar Jul 06 '25 08:07 fbozhang

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 18 '25 04:10 stale[bot]