[ 
https://issues.apache.org/jira/browse/RANGER-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17605131#comment-17605131
 ] 

Ramachandran edited comment on RANGER-3847 at 9/16/22 3:18 AM:
---------------------------------------------------------------

In Ranger rest API if you pass an Invalid attribute type in the JSON request 
body,  it throws a 404 error instead of 400 (Bad Request). It seems a bug where 
we need to handle the JsonMappingException by adding Exception Mapper globally 
to handle incorrect JSON format or Invalid attribute type in the JSON request 
body otherwise our Rest API will throw a 404 error instead of 400 error cc >> 
[[email protected]]  [~abhayk]  [~rmani] .

 


was (Author: JIRAUSER295265):
In Ranger rest API if you pass an Invalid attribute type in the JSON request 
body,  it throws a 404 error instead of 400 (Bad Request). It seems a bug where 
we need to handle the JsonMappingException by adding Exception Mapper cc >> 
[[email protected]] 

 

> [Ranger] : Http status & Error message is not correct for /xaudit/trx_log
> -------------------------------------------------------------------------
>
>                 Key: RANGER-3847
>                 URL: https://issues.apache.org/jira/browse/RANGER-3847
>             Project: Ranger
>          Issue Type: Bug
>          Components: Ranger
>            Reporter: Anupam Rai
>            Priority: Minor
>
> [Ranger] : Http status & Error message is not correct for /xaudit/trx_log
> Request with bad request : Passing String values
> {code:java}
> curl --location --request POST 'https://---------/service/xaudit/trx_log' \
> --header 'Authorization: Basic XXXXX==' \
> --header 'Accept: application/json' \
> --header 'Content-Type: application/json' \
> --data-raw '{
>   "objectClassType" : "abcdef",
>   "objectId" : "abcdef"
> }' {code}
> Response : 404 Not Found
> Request with proper request : Passing int values
> {code:java}
> curl --location --request POST 
> 'https://----------------/service/xaudit/trx_log' \
> --header 'Authorization: Basic XXXX=' \
> --header 'Accept: application/json' \
> --header 'Content-Type: application/json' \
> --data-raw '{
>   "objectClassType" : "123456",
>   "objectId" : "1234567"
> }' {code}
> Response : ok 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to