Membrane API Gateway returns 500 Internal Server Error when the OpenAPI validator hits an unexpected error while validating the backend response against the OpenAPI document. This is not a validation result about the response. It indicates an internal error in Membrane, or an OpenAPI construct the validator cannot handle.
The response contains the status 500 Internal Server Error, the title User error., the detail Message could not be validated against OpenAPI cause of an error during validation. Please check the OpenAPI with title Fruit Shop API. with the title of the document, the exception, the problem type https://membrane-api.io/problems/user and a link to this page. The error happens in the response flow, so the client receives 500. In production mode, the title is replaced by Internal Server Error and the detail by a log key.
If the backend response violates the OpenAPI document, Membrane answers with an OpenAPI message validation failed error instead, which lists the violations.
For an API deployed from an OpenAPI document with validateResponses on, the validator checks the status, headers and body of each backend response against the response definitions of the operation. This error means that the check itself failed.
An unusual combination of response and OpenAPI document triggers an error in the validator, for example a NullPointerException. This usually indicates a bug in Membrane.
The response definitions use a construct that the validator does not support.
As a temporary workaround, switch off response validation for the document:
api:
port: 2000
openapi:
- location: fruitshop-api.yml
validateResponses: false
api:
port: 2000
openapi:
- location: fruitshop-api.yml
validateResponses: false
By default, Membrane runs in development mode and adds details to error responses that help you find the problem. These details may reveal information about your setup. In production, turn them off:
configuration:
production: trueconfiguration: production: true
Add the configuration document to your apis.yaml and separate it from the APIs with ---.
Configuration reference:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.