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

Valid call returns 500 without neither logging nor validation error #407

Open
walles opened this issue Dec 13, 2022 · 0 comments
Open

Valid call returns 500 without neither logging nor validation error #407

walles opened this issue Dec 13, 2022 · 0 comments

Comments

@walles
Copy link

walles commented Dec 13, 2022

With openapi-cop 5cb4e9f running in Docker, I get a 500 back from the proxy but no indication of any errors.

I would expect one of:

  1. The original (valid) 404 response
  2. An explanation of what's wrong, both on the openapi-cop console and in the Openapi-Cop-Validation-Result header I got back

Sequence Diagram

sequenceDiagram
    Test Driver->>openapi-cop: DELETE /internal/test/plans
    openapi-cop->>App Under Test: DELETE /internal/test/plans
    App Under Test->>openapi-cop: 404 (documented response)
    openapi-cop->>Test Driver: 500
Loading

Log Output

Console output, note the "valid": true line.

pfcapi-openapi-cop-1            | 2022-12-13T12:33:40.431Z openapi-cop:proxy Received server response with status code 404
pfcapi-openapi-cop-1            | 2022-12-13T12:33:40.432Z openapi-cop:proxy Validation results [DELETE /internal/test/plans] {
pfcapi-openapi-cop-1            |   "request": {
pfcapi-openapi-cop-1            |     "valid": true,
pfcapi-openapi-cop-1            |     "errors": null
pfcapi-openapi-cop-1            |   }
pfcapi-openapi-cop-1            | }

Received by Test Driver

Note the combination of 500 and \"valid\":true.

HTTP/1.1 500 Internal Server Error
Connection: close
Date: Tue, 13 Dec 2022 12:33:40 GMT
Openapi-Cop-Source-Request: {\"method\":\"DELETE\",\"path\":\"/internal/test/plans\",\"headers\":{\"host\":\"subscriptions:5048\",\"user-agent\":\"Go-http-client/1.1\",\"authorization\":\"Basic ***\",\"x-request-id\":\"***\",\"x-span-parent-id\":\"***\",\"accept-encoding\":\"gzip\",\"connection\":\"close\"},\"query\":{}}
Openapi-Cop-Validation-Result: {\"request\":{\"valid\":true,\"errors\":null}}
X-Powered-By: Express
Content-Length: 0

Openapi-Cop-Source-Request

Expanded from ^

{
    "method": "DELETE",
    "path": "/internal/test/plans",
    "headers": {
        "host": "subscriptions:5048",
        "user-agent": "Go-http-client/1.1",
        "authorization": "Basic ***",
        "x-request-id": "***",
        "x-span-parent-id": "***",
        "accept-encoding": "gzip",
        "connection": "close"
    },
    "query": {}
}
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

1 participant