{"action":"opened","issue":{"url":"https://api.github.com/repos/zalando/connexion/issues/770","repository_url":"https://api.github.com/repos/zalando/connexion","labels_url":"https://api.github.com/repos/zalando/connexion/issues/770/labels{/name}","comments_url":"https://api.github.com/repos/zalando/connexion/issues/770/comments","events_url":"https://api.github.com/repos/zalando/connexion/issues/770/events","html_url":"https://github.com/zalando/connexion/issues/770","id":379296591,"node_id":"MDU6SXNzdWUzNzkyOTY1OTE=","number":770,"title":"strict_validation returning 404 instead of 400 as described in documentation","user":{"login":"starhawking","id":1923850,"node_id":"MDQ6VXNlcjE5MjM4NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1923850?v=4","gravatar_id":"","url":"https://api.github.com/users/starhawking","html_url":"https://github.com/starhawking","followers_url":"https://api.github.com/users/starhawking/followers","following_url":"https://api.github.com/users/starhawking/following{/other_user}","gists_url":"https://api.github.com/users/starhawking/gists{/gist_id}","starred_url":"https://api.github.com/users/starhawking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starhawking/subscriptions","organizations_url":"https://api.github.com/users/starhawking/orgs","repos_url":"https://api.github.com/users/starhawking/repos","events_url":"https://api.github.com/users/starhawking/events{/privacy}","received_events_url":"https://api.github.com/users/starhawking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-09T19:42:37Z","updated_at":"2018-11-09T19:42:37Z","closed_at":null,"author_association":"NONE","body":"### Description\r\n\r\nThe documentation says that `strict_validation` should return a 400, however it appears to be returning a 404 instead\r\n\r\nPer the documentation at https://connexion.readthedocs.io/en/latest/request.html#parameter-validation\r\n\r\n> Connexion can apply strict parameter validation for query and form data parameters. When this is enabled, requests that include parameters not defined in the swagger spec return a 400 error.\r\n\r\n### Expected behaviour\r\n\r\nConnexion returns a 400 Bad Request when a parameter does not match the schema\r\n\r\n### Actual behaviour\r\n\r\nConnexion returns a 404 Not Found when a parameter does not match the schema\r\n\r\n### Steps to reproduce\r\n\r\n#### Sample Curl Results\r\n```\r\nconnexion issue> curl -i localhost:5000/has-param/1\r\nHTTP/1.0 200 OK\r\nContent-Type: application/json\r\nContent-Length: 2\r\nServer: Werkzeug/0.14.1 Python/3.6.4\r\nDate: Fri, 09 Nov 2018 19:31:03 GMT\r\n\r\n1\r\nconnexion issue> curl -i localhost:5000/has-param/a\r\nHTTP/1.0 404 NOT FOUND\r\nContent-Type: application/problem+json\r\nContent-Length: 206\r\nServer: Werkzeug/0.14.1 Python/3.6.4\r\nDate: Fri, 09 Nov 2018 19:30:55 GMT\r\n\r\n{\r\n  \"detail\": \"The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.\",\r\n  \"status\": 404,\r\n  \"title\": \"Not Found\",\r\n  \"type\": \"about:blank\"\r\n}\r\n```\r\n\r\n#### Sample Code\r\n```main.py\r\nimport connexion\r\nfrom connexion.resolver import RestyResolver\r\n\r\ndef get_has_param(demoId):\r\n    return demoId\r\n\r\nif __name__ == '__main__':\r\n    app = connexion.FlaskApp(__name__)\r\n    app.add_api(\r\n        'request-validation-demo.yaml',\r\n        validate_responses=True,\r\n        strict_validation=True,\r\n    )\r\n    app.run()\r\n```\r\n\r\n#### Sample OpenAPI v3 Document\r\n\r\n```\r\nopenapi: 3.0.0\r\ninfo:\r\n  title: This should be returning a 400 on an invalid parameter\r\n  version: '0'\r\npaths:\r\n  /has-param/{demoId}:\r\n    get:\r\n      summary: This should be returning a 400 when it gets an invalid parameter, not a 404\r\n      operationId: main.get_has_param\r\n      parameters:\r\n        - name: demoId\r\n          in: path\r\n          required: true\r\n          description: This should be a 400 when invalid\r\n          schema:\r\n            type: integer\r\n      responses:\r\n        200:\r\n          description: Demo Result\r\n          content:\r\n            application/json:\r\n              schema:\r\n                type: integer\r\n        400:\r\n          description: Demo 400\r\n          content:\r\n            application/json:\r\n              schema:\r\n                $ref: '#/components/schemas/Error'\r\n        404:\r\n          description: Demo 404\r\n          content:\r\n            application/json:\r\n              schema:\r\n                $ref: '#/components/schemas/Error'\r\ncomponents:\r\n  schemas:\r\n    Error:\r\n      required:\r\n        - code\r\n        - message\r\n      properties:\r\n        code:\r\n          type: integer\r\n        message:\r\n          type: string\r\n```\r\n\r\n### Additional info:\r\n\r\nOutput of the commands:\r\n\r\n```\r\nconnexion issue> python3 --version\r\nPython 3.6.4\r\nconnexion issue> pip3 show connexion | grep \"^Version\\:\"\r\nVersion: 2.0.1\r\nconnexion issue>\r\n```"}}
{"actor":{"display_login":"starhawking"}}