Bug: crash on 404 when resource ID type does not match query string
See original GitHub issueDescription
See https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/631#issuecomment-559562320
Looking at the changes, the trim/split/findindex url parsing feels a bit brittle to me. Wouldn’t it be an option to use the route values, like it is done at: https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/d9dd76069a35bfbd8bb180ff83213014d2601b10/src/JsonApiDotNetCore/Middleware/CurrentRequestMiddleware.cs#L251?
For example, the debugger shows me for the request path:
api/v3/users/ABC/completions
these route values:
{
"action": "GetRelationship"
"controller": "Users"
"id": "ABC"
"relationshipName": "completions"
}
Hope this helps.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
What response code corresponds in REST API to not ...
I don't think it is a 404 error because /users endpoint exists,. The resource identifier includes the query params. Which is to say, ......
Read more >Should I return a 204 or a 404 response when a resource ...
HTTP 204 means that something was found, but it's empty. For instance, imagine that you're serving log files through HTTP, with the requests ......
Read more >null data returned when resource not found · Issue #631 ...
Description Earlier, when a resource does not exist, a 404 with ... Bug: crash on 404 when resource ID type does not match...
Read more >APIM returning 404 when mandatory query parameter is ...
I have an APIM instance with an OpenAPI spec imported. One of the endpoints has a mandatory query parameter, with application-level ...
Read more >Error 404: 4 Ways to Fix It
Error 404 is a response code, meaning the server could not locate the requested content. Check this article to learn 4 steps to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I getcha, but will work on this tomorrow.
/cc @wisepotato