Closed hirosumee closed 4 months ago
Thanks for reporting this, I'll push out a fix today.
The latest release candidate build contains a fix for this as well as new tests to ensure it doesn't pop up again:
https://github.com/jaredhendrickson13/pfsense-api/releases/tag/v2.0.0-rc-217e88f
Describe the bug When tried to call
/api/v2/firewall/nat/one_to_one/mappings
endpoint , i faced the below 500 response code{ "code": 500, "status": "internal server error", "response_id": "ENDPOINT_RECEIVED_UNEXPECTED_ERROR", "message": "Named parameter $parent_id overwrites previous argument\n#0 /usr/local/pkg/RESTAPI/Core/Model.inc(1554): RESTAPI\\Models\\OneToOneNATMapping->__construct(parent_id: NULL)\n#1 /usr/local/pkg/RESTAPI/Core/Model.inc(1737): RESTAPI\\Core\\Model::read_all(NULL, 0, 0)\n#2 /usr/local/pkg/RESTAPI/Core/Endpoint.inc(742): RESTAPI\\Core\\Model::query(Array, Array, NULL, 0, 0)\n#3 /usr/local/pkg/RESTAPI/Core/Endpoint.inc(688): RESTAPI\\Core\\Endpoint->get()\n#4 /usr/local/www/api/v2/firewall/nat/one_to_one/mappings/index.php(3): RESTAPI\\Core\\Endpoint->process_request()\n#5 {main}", "data": [] }
To Reproduce Steps to reproduce the behavior:
/api/v2/firewall/nat/one_to_one/mappings
Expected behavior Return list of one_to_one mapping list
Screenshots or Response
pfSense Version & Package Version:
Affected Endpoints:
Additional context