question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: crash on 404 when resource ID type does not match query string

See original GitHub issue

Description

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:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
wisepotatocommented, Dec 18, 2019

I getcha, but will work on this tomorrow.

1reaction
bart-degreedcommented, Nov 29, 2019
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found