json-api-dotnet / JsonApiDotNetCore

A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core.
https://www.jsonapi.net
MIT License
662 stars 160 forks source link

Allow relaxed Content-Type for atomic operations #1553

Closed bkoelman closed 1 month ago

bkoelman commented 1 month ago

This PR permits using a relaxed (simpler) variant of the atomic:operations media type in the Content-Type request/response HTTP header, because OpenAPI client generators often choke on the double quotes in the official media type (producing code that doesn't compile). By default, the Content-Type used for responses is the same as the incoming one, although it can be overruled by sending an Accept HTTP header.

Official header value (existing): application/vnd.api+json; ext="https://jsonapi.org/ext/atomic" Relaxed variant (added in this PR): application/vnd.api+json; ext=atomic-operations

QUALITY CHECKLIST

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.84%. Comparing base (a8ff4ec) to head (94d7332).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1553 +/- ## ========================================== + Coverage 90.81% 90.84% +0.02% ========================================== Files 346 346 Lines 11063 11097 +34 Branches 1815 1821 +6 ========================================== + Hits 10047 10081 +34 Misses 669 669 Partials 347 347 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.