swaggest / openapi-go

OpenAPI structures for Go
https://pkg.go.dev/github.com/swaggest/openapi-go/openapi3
MIT License
248 stars 23 forks source link

Add RequestBodyEnforcer #12

Closed vearutop closed 4 years ago

vearutop commented 4 years ago

In some situations existing API is violating HTTP guidelines and uses GET or HEAD with request body.

This PR enables a workaround to allow such configurations by implementing empty ForceRequestBody() function on input structure.

codecov[bot] commented 4 years ago

Codecov Report

Merging #12 into master will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   12.05%   12.08%   +0.02%     
==========================================
  Files           5        5              
  Lines        4088     4089       +1     
==========================================
+ Hits          493      494       +1     
  Misses       3538     3538              
  Partials       57       57              
Impacted Files Coverage Δ
openapi3/reflect.go 84.39% <100.00%> (+0.09%) :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 c774271...9e31372. Read the comment docs.