Skip to content

Commit 860bcc4

Browse files
addressing Andrea's feedback
1 parent 73f3ca1 commit 860bcc4

File tree

9 files changed

+77
-74
lines changed

9 files changed

+77
-74
lines changed

aws_lambda_powertools/event_handler/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
BedrockFunctionResponse,
1818
)
1919
from aws_lambda_powertools.event_handler.events_appsync.appsync_events import AppSyncEventsResolver
20-
from aws_lambda_powertools.event_handler.http_resolver import HttpResolverAlpha
20+
from aws_lambda_powertools.event_handler.http_resolver import HttpResolverLocal
2121
from aws_lambda_powertools.event_handler.lambda_function_url import (
2222
LambdaFunctionUrlResolver,
2323
)
@@ -35,7 +35,7 @@
3535
"BedrockResponse",
3636
"BedrockFunctionResponse",
3737
"CORSConfig",
38-
"HttpResolverAlpha",
38+
"HttpResolverLocal",
3939
"LambdaFunctionUrlResolver",
4040
"Response",
4141
"VPCLatticeResolver",

aws_lambda_powertools/event_handler/http_resolver.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,26 +164,29 @@ def get_remaining_time_in_millis(self) -> int: # pragma: no cover
164164
return 300000 # 5 minutes
165165

166166

167-
class HttpResolverAlpha(ApiGatewayResolver):
167+
class HttpResolverLocal(ApiGatewayResolver):
168168
"""
169-
ASGI-compatible HTTP resolver for local development and testing (Alpha).
169+
ASGI-compatible HTTP resolver for local development and testing.
170170
171-
Works with any ASGI server like uvicorn, hypercorn, daphne, etc.
172-
Maintains full compatibility with Lambda - same code works in both environments.
171+
This resolver is designed specifically for local development workflows.
172+
It allows you to run your Powertools application locally with any ASGI server
173+
(uvicorn, hypercorn, daphne, etc.) while maintaining full compatibility with Lambda.
174+
175+
The same code works in both environments - locally via ASGI and in Lambda via the handler.
173176
174177
Supports both sync and async route handlers.
175178
176179
WARNING
177180
-------
178-
This is an Alpha feature intended for local development and testing only.
181+
This is intended for local development and testing only.
179182
The API may change in future releases. Do not use in production environments.
180183
181184
Example
182185
-------
183186
```python
184-
from aws_lambda_powertools.event_handler import HttpResolverAlpha
187+
from aws_lambda_powertools.event_handler import HttpResolverLocal
185188
186-
app = HttpResolverAlpha()
189+
app = HttpResolverLocal()
187190
188191
@app.get("/hello/<name>")
189192
async def hello(name: str):
@@ -212,7 +215,7 @@ def __init__(
212215
enable_validation: bool = False,
213216
):
214217
warnings.warn(
215-
"HttpResolverAlpha is an alpha feature intended for local development and testing only. "
218+
"HttpResolverLocal is intended for local development and testing only. "
216219
"The API may change in future releases. Do not use in production environments.",
217220
stacklevel=2,
218221
)

docs/core/event_handler/api_gateway.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ By default, we will use `APIGatewayRestResolver` throughout the documentation. Y
6363
| **[`ALBResolver`](#application-load-balancer)** | Amazon Application Load Balancer (ALB) |
6464
| **[`LambdaFunctionUrlResolver`](#lambda-function-url)** | AWS Lambda Function URL |
6565
| **[`VPCLatticeResolver`](#vpc-lattice)** | Amazon VPC Lattice |
66-
| **[`HttpResolverAlpha`](#http-resolver-alpha)** | Local development with ASGI servers |
66+
| **[`HttpResolverLocal`](#http-resolver-local)** | Local development with ASGI servers |
6767
<!-- markdownlint-enable MD051 -->
6868

6969
#### Response auto-serialization
@@ -194,7 +194,7 @@ When using [VPC Lattice with AWS Lambda](https://docs.aws.amazon.com/lambda/late
194194
--8<-- "examples/event_handler_rest/src/getting_started_vpclattice_resolver.json"
195195
```
196196

197-
--8<-- "docs/includes/_http_resolver_alpha.md"
197+
--8<-- "docs/includes/_http_resolver_local.md"
198198

199199
### Dynamic routes
200200

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!-- markdownlint-disable MD041 MD043 -->
2-
#### Http Resolver (Alpha)
2+
#### Http Resolver (Local Development)
33

4-
???+ warning "Alpha Feature"
5-
`HttpResolverAlpha` is an alpha feature intended for local development and testing only.
4+
???+ warning "Local Development Only"
5+
`HttpResolverLocal` is intended for local development and testing only.
66
The API may change in future releases. **Do not use in production environments.**
77

8-
When developing locally, you can use `HttpResolverAlpha` to run your API with any ASGI server like [uvicorn](https://www.uvicorn.org/){target="_blank"}. It implements the [ASGI specification](https://asgi.readthedocs.io/){target="_blank"}, is lightweight with no external dependencies, and the same code works on any compute platform, including Lambda.
8+
When developing locally, you can use `HttpResolverLocal` to run your API with any ASGI server like [uvicorn](https://www.uvicorn.org/){target="_blank"}. It implements the [ASGI specification](https://asgi.readthedocs.io/){target="_blank"}, is lightweight with no external dependencies, and the same code works on any compute platform, including Lambda.
99

1010
If your Lambda is behind [Lambda Web Adapter](https://github.com/awslabs/aws-lambda-web-adapter){target="_blank"} or any other HTTP proxy that speaks the HTTP protocol, it works seamlessly.
1111

examples/event_handler_rest/src/http_resolver_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from aws_lambda_powertools.event_handler import HttpResolverAlpha
1+
from aws_lambda_powertools.event_handler import HttpResolverLocal
22

3-
app = HttpResolverAlpha()
3+
app = HttpResolverLocal()
44

55

66
@app.get("/hello/<name>")

examples/event_handler_rest/src/http_resolver_exception_handling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from aws_lambda_powertools.event_handler import HttpResolverAlpha, Response
1+
from aws_lambda_powertools.event_handler import HttpResolverLocal, Response
22

3-
app = HttpResolverAlpha()
3+
app = HttpResolverLocal()
44

55

66
class NotFoundError(Exception):

examples/event_handler_rest/src/http_resolver_validation_swagger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from pydantic import BaseModel
22

3-
from aws_lambda_powertools.event_handler import HttpResolverAlpha
3+
from aws_lambda_powertools.event_handler import HttpResolverLocal
44

55

66
class User(BaseModel):
77
name: str
88
age: int
99

1010

11-
app = HttpResolverAlpha(enable_validation=True)
11+
app = HttpResolverLocal(enable_validation=True)
1212

1313
app.enable_swagger(
1414
title="My API",

tests/functional/event_handler/_pydantic/test_http_resolver_pydantic.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Tests for HttpResolverAlpha with Pydantic validation."""
1+
"""Tests for HttpResolverLocal with Pydantic validation."""
22

33
from __future__ import annotations
44

@@ -9,12 +9,12 @@
99
import pytest
1010
from pydantic import BaseModel, Field
1111

12-
from aws_lambda_powertools.event_handler import HttpResolverAlpha
12+
from aws_lambda_powertools.event_handler import HttpResolverLocal
1313
from aws_lambda_powertools.event_handler.http_resolver import MockLambdaContext
1414
from aws_lambda_powertools.event_handler.openapi.params import Query
1515

16-
# Suppress alpha warning for all tests
17-
pytestmark = pytest.mark.filterwarnings("ignore:HttpResolverAlpha is an alpha feature")
16+
# Suppress warning for all tests
17+
pytestmark = pytest.mark.filterwarnings("ignore:HttpResolverLocal is intended for local development")
1818

1919

2020
# =============================================================================
@@ -65,7 +65,7 @@ class UserResponse(BaseModel):
6565

6666
def test_valid_body_validation():
6767
# GIVEN an app with validation enabled and a route expecting UserModel
68-
app = HttpResolverAlpha(enable_validation=True)
68+
app = HttpResolverLocal(enable_validation=True)
6969

7070
@app.post("/users")
7171
def create_user(user: UserModel) -> UserResponse:
@@ -92,7 +92,7 @@ def create_user(user: UserModel) -> UserResponse:
9292

9393
def test_invalid_body_validation():
9494
# GIVEN an app with validation enabled
95-
app = HttpResolverAlpha(enable_validation=True)
95+
app = HttpResolverLocal(enable_validation=True)
9696

9797
@app.post("/users")
9898
def create_user(user: UserModel) -> UserResponse:
@@ -118,7 +118,7 @@ def create_user(user: UserModel) -> UserResponse:
118118

119119
def test_missing_required_field():
120120
# GIVEN an app with validation enabled
121-
app = HttpResolverAlpha(enable_validation=True)
121+
app = HttpResolverLocal(enable_validation=True)
122122

123123
@app.post("/users")
124124
def create_user(user: UserModel) -> UserResponse:
@@ -147,7 +147,7 @@ def create_user(user: UserModel) -> UserResponse:
147147

148148
def test_query_param_validation():
149149
# GIVEN an app with validated query parameters
150-
app = HttpResolverAlpha(enable_validation=True)
150+
app = HttpResolverLocal(enable_validation=True)
151151

152152
@app.get("/search")
153153
def search(
@@ -179,7 +179,7 @@ def search(
179179

180180
def test_invalid_query_param():
181181
# GIVEN an app with validated query parameters
182-
app = HttpResolverAlpha(enable_validation=True)
182+
app = HttpResolverLocal(enable_validation=True)
183183

184184
@app.get("/search")
185185
def search(
@@ -212,7 +212,7 @@ def search(
212212
@pytest.mark.asyncio
213213
async def test_async_handler_with_validation():
214214
# GIVEN an app with async handler and validation
215-
app = HttpResolverAlpha(enable_validation=True)
215+
app = HttpResolverLocal(enable_validation=True)
216216

217217
@app.post("/users")
218218
async def create_user(user: UserModel) -> UserResponse:
@@ -247,7 +247,7 @@ async def create_user(user: UserModel) -> UserResponse:
247247

248248
def test_openapi_schema_generation():
249249
# GIVEN an app with validation and multiple routes
250-
app = HttpResolverAlpha(enable_validation=True)
250+
app = HttpResolverLocal(enable_validation=True)
251251

252252
@app.get("/users/<user_id>")
253253
def get_user(user_id: str) -> dict:
@@ -272,7 +272,7 @@ def create_user(user: UserModel) -> UserResponse:
272272

273273
def test_openapi_schema_includes_validation_errors():
274274
# GIVEN an app with validation
275-
app = HttpResolverAlpha(enable_validation=True)
275+
app = HttpResolverLocal(enable_validation=True)
276276

277277
@app.post("/users")
278278
def create_user(user: UserModel) -> UserResponse:

0 commit comments

Comments
 (0)