You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected Behavior (or desired behavior if a feature request)
Calling the API URI: /api/v1/hardware/bytag/<asset tag> on an asset tag that does not exist should return an HTTP 200 status code.
Actual Behavior
Calling the API URI: /api/v1/hardware/bytag/<asset tag> on an asset tag that does not exist returns an HTTP 404 status code, with a proper JSON response body.
This is inconsistent with the documentations philosophy: For example, if you made a valid HTTP request to retrieve an asset that doesn't exist, we'll return a 200 OK
Is this a fresh install or an upgrade?
Fresh install (docker image)
Version of Snipe-IT you're running
v4.6.7 - build 3944 (master)
Version of PHP you're running
Whichever version is in the latest docker tag.
Version of MySQL/MariaDB you're running
MySQL 5.6
What OS and web server you're running Snipe-IT on
Ubuntu
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
Docker
What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
Using the REST API against /api/v1/hardware/bytag/<asset tag>
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
{'messages': 'Asset not found', 'payload': None, 'status': 'error'}
So what is the intended way to check for an "asset not found"? To check the status key? That doesn't quite conflict with the status_label key on the valid asset data, but you can see this is kind of ambiguous.
Returning a 404 seems like the expected result. Of course, this leads to ambiguity between an improper request URL, and a properly-formatted request not finding an asset.
Expected Behavior (or desired behavior if a feature request)
Calling the API URI:
/api/v1/hardware/bytag/<asset tag>
on an asset tag that does not exist should return an HTTP 200 status code.Actual Behavior
Calling the API URI:
/api/v1/hardware/bytag/<asset tag>
on an asset tag that does not exist returns an HTTP 404 status code, with a proper JSON response body.This is inconsistent with the documentations philosophy:
For example, if you made a valid HTTP request to retrieve an asset that doesn't exist, we'll return a 200 OK
Sample Request:
Response:
Please confirm you have done the following before posting your bug report:
Provide answers to these questions:
Is this a fresh install or an upgrade?
Fresh install (docker image)
Version of Snipe-IT you're running
v4.6.7 - build 3944 (master)
Version of PHP you're running
Whichever version is in the latest docker tag.
MySQL 5.6
Ubuntu
Docker
Using the REST API against
/api/v1/hardware/bytag/<asset tag>
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
https://snipe-it.readme.io/docs/getting-help
The text was updated successfully, but these errors were encountered: