JsonApiDotNetCore icon indicating copy to clipboard operation
JsonApiDotNetCore copied to clipboard

Include HTTP headers

Open bkoelman opened this issue 2 years ago • 0 comments

Swagger UI currently does not display HTTP request/response headers.

This should be possible, according to https://github.com/mattfrear/Swashbuckle.AspNetCore.Filters#add-a-response-header.

Headers to describe in OAS:

  • Location (out) on POST resource endpoint
  • If-None-Match (in) on GET/HEAD endpoints
  • ETag (out) on GET/HEAD endpoints
  • Content-Length (out) on HEAD requests

As a safety mechanism, an incoming If-Match produces an error that indicates wrong usage. There's no need to include it in OAS.

HTTP-level caching is one of the key advantages of using JSON:API, compared to competing technologies. So we should strive to offer the experience described at https://www.jsonapi.net/usage/caching.html using generated client libraries.

bkoelman avatar Oct 25 '23 11:10 bkoelman