Trailing slash in REST API DOES matter

This is like a reminder to myself but assumed others might also be interested in it.

When designing REST API, remember that every character in the URI is important and constitutes unique resource. Hence:

is different than

AWS API Gateway is not different in this case, so pay extra attention as you define e.g. triggers for your lambdas in SAM file:

    Type: AWS::Serverless::Function
    Properties: (...)
          Type: Api
            Path: /cars
            Method: get

Mind this /cars value for Path. It means that you can access this resources (here: lambda) only when you’ll enter /cars URL and not /cars/.

It might be REST APIs 101 but still - it might easily be forgotten!