Bug using the sort_by parameter with /api/v2/services/dhcp_server/static_mapping #639
Replies: 2 comments 1 reply
-
Hello, have you had a minute to check this bug? :) Thank you! |
Beta Was this translation helpful? Give feedback.
-
I wouldn't consider this a bug because PHP sorts strings based on their characters by default, not numerically. Currently, the API relies on PHP's default sort behavior and doesn't allow changing the sort flag. However, this highlights a valid use case for supporting different PHP sort flags—using SORT_NATURAL, for example, would achieve your desired result. I've created #646 to track this as an enhancement. It's a small change, so it could be feasibly included in a patch release instead of waiting for the next minor version. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I encounter an error I didn't have before, when using the
"sort_by": "ipaddr"
parameter with the POST request to/api/v2/services/dhcp_server/static_mapping
to add a static mapping, IPs are not correctly reordered.It goes from: X.X.X.139 to X.X.X.14 instead X.X.X.139, X.X.X.140, X.X.X.141, ...
Same thing with X.X.X.149 to X.X.X.15, is this a known problem?
I'm currently using API v2.3.1 with pfSense v24.03
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions