swaggest / rest

Web services with OpenAPI and JSON Schema done quick in Go
https://pkg.go.dev/github.com/swaggest/rest
MIT License
335 stars 17 forks source link

Only application/json should be allowed by default #158

Closed pboguslawski closed 1 year ago

pboguslawski commented 1 year ago

According to https://github.com/swaggest/rest/issues/113 valid JSON Content-Type is application/json.

According to https://datatracker.ietf.org/doc/html/rfc2045#section-5.1 Content-Type values should be compared in case-insensitive manner.

Fixes: https://github.com/swaggest/rest/issues/134 Author-Change-Id: IB#1131224

codecov[bot] commented 1 year ago

Codecov Report

Merging #158 (6fefa4e) into master (dee7f9f) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #158   +/-   ##
=======================================
  Coverage   77.79%   77.79%           
=======================================
  Files          28       28           
  Lines        1608     1608           
=======================================
  Hits         1251     1251           
  Misses        235      235           
  Partials      122      122           
Flag Coverage Δ
unittests 77.79% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
request/jsonbody.go 97.29% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more