With a HttpAPI definition like so:
functions:
my_function:
name: my-function
handler: handler.php
description: ''
runtime: php-83
events:
- httpApi: 'ANY /{param}'
The error 404 - Route '/myroute' not found in serverless.yml is returned.
This issue lies in Router::fromServerlessConfig() and Router::matchesMethod().
- fromServerlessConfig only does extra parsing on array definitions via
patternToString. In this case only a lower-case any is converted to *. Uppercase ANY is always skipped. No extra checks are done on strings.
- matchesMethod will only look for
*, assuming that the upstream call to fromServerlessConfig has correctly parsed and converted ANY to a wildcard.
In both cases a valid API gateway definition is skipped.
With a HttpAPI definition like so:
The error
404 - Route '/myroute' not found in serverless.ymlis returned.This issue lies in
Router::fromServerlessConfig()andRouter::matchesMethod().patternToString. In this case only a lower-caseanyis converted to*. UppercaseANYis always skipped. No extra checks are done on strings.*, assuming that the upstream call to fromServerlessConfig has correctly parsed and converted ANY to a wildcard.In both cases a valid API gateway definition is skipped.