Open edvasqueza opened 7 years ago
Hello, I noticed that javax.ws.rs Exceptions are not considered by the analyzer. For example this code:
@POST @Path("/enrollment") public Response enrollment(@Valid Enrollment request) { if (userService.enrollment(request)) { return Response.noContent().build(); } else { throw new javax.ws.rs.BadRequestException("Bad request"); } }
generates:
POST koath/internal/enrollment: Request: Content-Type: application/json Request Body: cl.kunder.koath.rest.requests.Enrollment application/json: {"id":"string","hash":"string"} Response: Content-Type: application/json Status Codes: 204
It should have added: Status Codes: 400
Status Codes: 400
My actual code has the exception inside the enrollment method, but same result.
Also consider exceptions that extend javax.ws.rs exceptions.
Yes, this is due to how the analysis currently works. It takes the control flow into account, but not exception flows.
Hello, I noticed that javax.ws.rs Exceptions are not considered by the analyzer. For example this code:
generates:
It should have added:
Status Codes: 400
My actual code has the exception inside the enrollment method, but same result.
Also consider exceptions that extend javax.ws.rs exceptions.