hoeyi / Ozym

A web-application for tracking personal finances. Built using Blazor, ASP.NET Core, and Entity Framework Core.
3 stars 0 forks source link

GET request for invesmtent performance by attribute endpoint returns error 415 - Unsupported media type #244

Closed hoeyi closed 5 months ago

hoeyi commented 5 months ago

Describe the bug

GET requests submitted to the endpoint /accounts/{id1]/performance{id2} return an error 415 - Unsupported media type response.

To Reproduce Steps to reproduce the behavior:

  1. Build using commit 17a05daebe4a1981b5cccc7e9f084538eaf0161e.
  2. Attempt to access endpoint /accounts/{id1]/performance{id2} where known values exist for id1 and id2.
  3. See error 415 response.

Expected behavior

The response should return the matching records in JSON format.

Additional context

It looks like the issue may be the default routing when using the HttpGet attribute in ASP.NET Core. Compare the use of HttpGet in ApiController versus ApiCollectionController.