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

Make PUT requests working #56

Closed plavjanik closed 4 years ago

plavjanik commented 4 years ago

These changes make PUT requests working:

  1. CSRF is disabled for the API request. It is still enabled for other endpoints.
  2. A sample PUT request is added to GreetingController
    • A very difficult problem is that the class that is in @RequestBody need to allow setters for all fields and @NoArgsConstructor otherwise requests will fail with 400
  3. A short guide on Java debugging has been added

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

codecov[bot] commented 4 years ago

Codecov Report

Merging #56 into master will increase coverage by 0.41%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #56      +/-   ##
============================================
+ Coverage     79.45%   79.86%   +0.41%     
- Complexity       43       45       +2     
============================================
  Files            21       21              
  Lines           146      149       +3     
  Branches          3        3              
============================================
+ Hits            116      119       +3     
  Misses           28       28              
  Partials          2        2
Impacted Files Coverage Δ Complexity Δ
...we/sample/apiservice/config/WebSecurityConfig.java 100% <100%> (ø) 3 <1> (ø) :arrow_down:
...sample/apiservice/greeting/GreetingController.java 100% <100%> (ø) 6 <2> (+2) :arrow_up:

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 29b6e9d...7ff1919. Read the comment docs.

plavjanik commented 4 years ago

I tried so many antmatchers changes yesterday but didn't come across the one you used...

We probably don't need an example POST, but it was failing with the 401 too. Will this fix it?

This should fix it for POST and DELETE as well. I want to add a more complicated REST controller with all methods in the future.

I had to use the Java debugger to understand what is causing the error. There was no good error message coming out of Spring Security filters.