Membrane API Gateway returns 404 Not Found with the title No matching API found! when a request reaches an API deployed from OpenAPI documents, but its path does not start with the base path of any of these documents.
The response contains the status 404 Not Found, the title No matching API found!, the detail There is no API on the path /products deployed. Please check the path. with the requested path, the problem type https://membrane-api.io/problems/user and a link to this page. The type user means that the request or the configuration caused the problem, not an internal failure of the gateway.
An api with openapi entries can serve several OpenAPI documents. Each document is published under a base path, which Membrane takes from the path part of the servers URLs in the document, or from rewrite: basePath in the configuration. For a document with the server URL https://api.example.com/fruitshop/v2, the base path is /fruitshop/v2, and a request to /fruitshop/v2/products is validated against that document.
The OpenAPI validator selects the document whose base path the request path starts with. If there is none, it answers with this error. If no API matches the request at all, Membrane answers with 404 Invalid Path or Method instead.
The client calls /shop/products, but the server URL of the document is https://api.example.com/fruitshop/v2. Check the request for a missing or outdated prefix, such as an old version number.
If a plugin placed before the OpenAPI validator in the flow changes the request path, for example a rewriter, the path may no longer start with a base path by the time it is validated.
Membrane adds openapiPublisher and openapiValidator at the top of the flow automatically. If you place openapiPublisher manually after openapiValidator, requests for /api-docs may reach the validator first and fail with this error.
/api-docs on the gateway to see the deployed documents and their paths.servers URLs of the OpenAPI documents, or publish the API under a different path with rewrite:api:
port: 2000
openapi:
- location: fruitshop-api.yml
rewrite:
basePath: /shop
api:
port: 2000
openapi:
- location: fruitshop-api.yml
rewrite:
basePath: /shop
Put plugins that change the path after the OpenAPI validator, and put openapiPublisher before it, or leave both out so that Membrane places them. See Rewrite OpenAPI for more on rewriting.
Unlike most errors, this response is not shortened in production mode. It contains the detail and the link to this page even with production: true. The detail only repeats the path of the request, so it does not reveal information about your setup.
Configuration reference:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.