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

Support for additional fields in the error message format #63

Closed plavjanik closed 4 years ago

plavjanik commented 4 years ago

Example:

{
  "messages": [
    {
      "messageType": "ERROR",
      "messageNumber": "ZWEAS401",
      "messageContent": "The request has not been applied because it lacks valid authentication credentials for the target resource: Full authentication is required to access this resource",
      "messageReason": "The accessed resource requires authentication. The request is missing valid authentication credentials.",
      "messageAction": "Review the product documentation for more details about acceptable authentication. Verify that your credentials are valid and contact security administrator to obtain valid credentials.",
      "messageKey": "org.zowe.commons.rest.unauthorized",
      "messageInstanceId": "d9ef6577-f66c-4845-988d-89fc3d993d72",
      "messageComponent": "org.zowe.commons.spring.RestAuthenticationEntryPoint",
      "messageSource": "usilca32.lvn.broadcom.net:10180:zowesample"
    }
  ]
}

Signed-off-by: Petr Plavjanik plavjanik@gmail.com

codecov[bot] commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@20e1177). Click here to learn what that means. The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #63   +/-   ##
=========================================
  Coverage          ?   74.64%           
  Complexity        ?      267           
=========================================
  Files             ?       68           
  Lines             ?      990           
  Branches          ?       95           
=========================================
  Hits              ?      739           
  Misses            ?      209           
  Partials          ?       42
Impacted Files Coverage Δ Complexity Δ
...a/org/zowe/commons/rest/response/BasicMessage.java 69.76% <ø> (ø) 18 <0> (?)
...main/java/org/zowe/commons/error/ErrorMessage.java 100% <100%> (ø) 1 <1> (?)
...we/sample/apiservice/config/ApplicationConfig.java 100% <100%> (ø) 3 <1> (?)
.../org/zowe/commons/spring/DefaultMessageSource.java 80% <80%> (ø) 3 <3> (?)
.../java/org/zowe/commons/error/ErrorServiceImpl.java 94.23% <90%> (ø) 15 <2> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 20e1177...d7d69e6. Read the comment docs.

plavjanik commented 4 years ago

@dkelosky @gejohnston Hello Gene and Dan, this PR adds support for the missing properties that you have noticed (action and reason) and others (component and source).

While testing, please use zowe deploy --force since there is a bug in JarPatcher - #62.

dkelosky commented 4 years ago

Thank you for the java stack picture; I'm trying to learn as much as I can about spring!