Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API call /flow_manager/v2/flows on DELETE is returning misleading response status #15

Open
ajoaoff opened this issue Jun 7, 2021 · 0 comments

Comments

@ajoaoff
Copy link

ajoaoff commented Jun 7, 2021

Original issue opened by @ArturoQuintana at kytos#135.

@hdiogenes @italovalcy @ajoaoff @rmotitsuki

  • If the payload items field is empty, it returns 200 when it should be 400.

Code:

def test_026_delete_flows_should_fail(self):
        """Test if the flow deletion process specifying an empty payload behaves as expected (400 Error)."""

        payload = {}

        # delete the flow
        api_url = KYTOS_API + '/flow_manager/v2/flows'
        response = requests.delete(api_url, data=json.dumps(payload),
                                   headers={'Content-type': 'application/json'})
        assert response.status_code == 400

The same happens with these cases:

payload = {
            "flows": [
            ]
        }

and

payload = {
            "flows": [
                {

                }
            ]
        }
  • A not serializable JSON broke the application, and it should return a 400 error.

Case:

payload = {
            "flows": [
                {
                    "priority"
                }
            ]
        }

The issue mentioned above should be verified for any not serializable JSON

@viniarck viniarck added enhancement New feature or request and removed enhancement New feature or request labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants