zowe / sample-spring-boot-api-service

Zowe REST API service SDK and sample API service that integrates with Zowe API Mediation Layer
Other
26 stars 18 forks source link

Method not allowed missing error message? #61

Open tucker01 opened 4 years ago

tucker01 commented 4 years ago

Maybe I'm missing something, but I removed any custom exception handlers in favor of what is being done in the commons jar:

https://github.com/zowe/sample-spring-boot-api-service/blob/master/zowe-rest-api-commons-spring/src/main/java/org/zowe/commons/spring/CustomRestExceptionHandler.java

For "403" I get the following response:

{
    "messages": [
        {
            "messageType": "ERROR",
            "messageNumber": "ZWEAS403",
            "messageContent": "The user is not authorized to the target resource: Access is denied",
            "messageKey": "org.zowe.commons.rest.forbidden",
            "messageInstanceId": "11a3da12-4895-42b5-81b1-e8e5e092c88d"
        }
    ]
}

For "405" I get no payload response? For us, its really not a big deal to have a message in the response body, the HTTP status is enough, but just wanted to check if this is expected behavior?

plavjanik commented 4 years ago

This is a bug for sure. Thank you for reporting it.

dkelosky commented 4 years ago

I was trying to reproduce via the pure sample but cannot. I used PUT on the /api/v1/greeting endpoint:

image

Maybe we can look offline to see what else might be going on?

tucker01 commented 4 years ago

OK sounds good. What version of the Commons Jar are you at?

dkelosky commented 4 years ago

I built commons from source. I'll retry my test with the last published commons jar.

tucker01 commented 4 years ago

OK we're at 'org.zowe:zowe-rest-api-commons-spring:0.4.2'

dkelosky commented 4 years ago

org.zowe:zowe-rest-api-commons-spring:0.5.1 seems to give the proper payload as well. Can you try on this version?

Thanks,

plavjanik commented 4 years ago

56 that is in v0.5.1 can be related

plavjanik commented 4 years ago

We should create a bug template that asks for a version and full specification of the request.

github-actions[bot] commented 4 years ago

This issue has not been updated in a long time.