Learn how Membrane serves an OpenAPI description, validates requests and responses against it, and rewrites the server URLs it advertises.
- Serving an OpenAPI description at
/api-docsand trying it out in the Swagger UI - Validating a JSON request against the schema and reading the resulting error
- Rewriting the
servers[].urlentries of a served OpenAPI document: automatically, pinned to explicit values, or overridden for a deployment behind a reverse proxy - Validating
application/x-www-form-urlencodedmessages - the format HTML forms post - against the same kind of schema: required fields, types and constraints, just like for JSON
To begin, open 10-OpenAPI.apis.yaml and follow the instructions in the file.
- OpenAPI 3.2 - the features added in OpenAPI 3.2 (the
QUERYmethod,itemSchema,in: querystring,xml.nodeType) and how Membrane validates requests against them.
The API Gateway Handbook explains OpenAPI rewriting in more depth:
- §6.2 OpenAPI URL Rewriting
— why the gateway rewrites the
serverssection. - §28.2 Rewriting of OpenAPI Addresses — the Membrane configuration for default and explicit rewriting, including deployments behind a reverse proxy.