laminas / laminas-json-server

Laminas Json-Server is a JSON-RPC server implementation.
https://docs.laminas.dev/laminas-json-server/
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

[Json/Server] Return the invalid parameters list #9

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7544 User: @dreadnought78 Created On: 2015-05-23T22:04:16Z Updated At: 2015-11-06T23:57:01Z Body If the user forgot or send some required parameter with a wrong name the server returns the error ERROR_INVALID_PARAMS.

This request added a invalid parameters list in the json response.

Result before

{
    "error":{
        "code":-32602,
        "message":"Invalid params",
        "data":null
    },
    "id":"8",
    "jsonrpc":"2.0"
}

Result after

{
    "error":{
        "code":-32602,
        "message":"Invalid param(s): [estimatedMonths, location, specieId, coatTypeId]",
        "data":null
    },
    "id":"8",
    "jsonrpc":"2.0"
}

*Please do not consider this pull request if this implementation has not been made before for security reasons.



Originally posted by @GeeH at https://github.com/zendframework/zend-json/issues/25

samsonasik commented 4 years ago

I transfered the issue to laminas/laminas-json-server