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/{dpid} on DELETE is returning misleading response status #16

Open
ajoaoff opened this issue Jun 7, 2021 · 1 comment

Comments

@ajoaoff
Copy link

ajoaoff commented Jun 7, 2021

Original issue opened by @ArturoQuintana at kytos#136.

@hdiogenes @italovalcy @ajoaoff @rmotitsuki

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

reflected on the end-to-end test:
tests/test_e2e_20_flow_manager.py::TestE2EFlowManager::test_022_delete_flow_should_fail

Code:

def test_022_delete_flow_should_fail(self):
        """Test if the flow deletion process specifying an unknown path behaves as expected (400 Error)."""

        payload = {}

        # delete the flow
        api_url = KYTOS_API + '/flow_manager/v2/flows/00:00:00:00:00:00:00:01'
        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
Copy link
Member

The lack of validation model validations also resulted in issue #43, as we can afford to prioritize models validation it should fix these sort of issues.

@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