Run_plugin endpoint in the Rest API should return a valid error when an incorrect graph_id is supplied
See original GitHub issuePrerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Running the latest version of Constellation
- Attached the Support Package via
Help
>Support Package
- Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ
- Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues
- Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories
Description
If you specify an invalid value for graph_id - The id of a graph to run the plugin on (optional)
it doesn’t run the plugin, but returns 200, as if it was successful. Instead it should return error 422.
(The valid graph_id could be retrieved from the get_graph
endpoint.)
Steps to Reproduce
- Load the Rest API (Tools-Start REST Server)
- Try out POST -
run_plugin
with an invalid text forgraph_id
Expected behaviour: Return error 422.
Actual behaviour: Returns 200, as if it was successful.
Reproduces how often: 100%
Additional Information
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Should a RESTful API return 400 or 404 when passed an ...
I would return 404 in case of resource does not exist(means the url path is wrong) and i will return 400 only if...
Read more >Best Practices for REST API Error Handling - Baeldung
The simplest way we handle errors is to respond with an appropriate status code. Here are some common response codes: 400 Bad Request...
Read more >Common REST API error codes - Azure Storage
Error code HTTP status code User message
AccountAlreadyExists Conflict (409) The specified account already exists.
AccountIsDisabled Forbidden (403) The specified account is disabled.
AccountProtectedFromDeletion Conflict (409)...
Read more >HTTP Status Codes in the REST API | UniProt help
This document explains the HTTP response headers returned by the UniProt REST API and gives some examples to make explicit what they mean....
Read more >REST API Developer Guide
You can use REST API tools to create, manipulate, and search data in Salesforce by sending HTTP requests to endpoints in Salesforce.
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 managed to get it to work by passing the
HttpServletResponse response
object to the services classes. But tricky to refactor the FileListener.java class.No worries thank you @Auriga2.
FileListener
is involved to get working and OK to skip at this point.