8000 minor · localstack/localstack@443f64a · GitHub
[go: up one dir, main page]

Skip to content

Commit 443f64a

Browse files
committed
minor
1 parent 1e64817 commit 443f64a

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

localstack-core/localstack/aws/handlers/openapi.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def __call__(self, chain: HandlerChain, context: RequestContext, response: Respo
3838
try:
3939
self.openapi.validate_request(WerkzeugOpenAPIRequest(context.request))
4040
except OpenAPIError as e:
41-
# Note: we only check request validations.
42-
# We could be more strict here and check for things such as ServerNotFound or OperationNotFound.
43-
# PathNotFound is handled by the last handler in request_handlers.
41+
# Note: we only check request body validation errors, like invalid body requests or missing required
42+
# parameters. Other things we do currently explicitly check are ServerNotFound, OperationNotFound,
43+
# and PathNotFound. They are most likely intercepted in the handler chain.
4444
match e:
4545
case RequestValidationError():
4646
response.status_code = 400
@@ -52,8 +52,7 @@ def __call__(self, chain: HandlerChain, context: RequestContext, response: Respo
5252

5353
class OpenAPIResponseValidator(OpenAPIRequestValidator):
5454
def __call__(self, chain: HandlerChain, context: RequestContext, response: Response):
55-
# We are more lenient in validating the responses, since there is no users fault involved.
56-
# We can eventually leverage this feature flag and be more strict in out test pipeline.
55+
# We are more lenient in validating the responses. The use of this flag is intended for test.
5756
if not config.OPENAPI_VALIDATE_RESPONSE:
5857
return
5958

localstack-core/localstack/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,7 @@ def use_custom_dns():
12551255
"LS_LOG",
12561256
"MAIN_CONTAINER_NAME",
12571257
"MAIN_DOCKER_NETWORK",
1258+
"OPENAPI_VALIDATE_REQUEST",
12581259
"OPENAPI_VALIDATE_RESPONSE",
12591260
"OPENSEARCH_ENDPOINT_STRATEGY",
12601261
"OUTBOUND_HTTP_PROXY",

localstack-core/localstack/spec.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
"url": "http://localhost.localstack.cloud:{port}",
4040
"variables": {"port": {"default": "4566"}},
4141
},
42-
{
43-
"url": "http://localhost:{port}",
44-
"variables": {"port": {"default": "4566"}},
45-
},
46-
{
47-
"url": "http://127.0.0.1:{port}",
48-
"variables": {"port": {"default": "4566"}},
49-
},
5042
],
5143
"components": {
5244
"schemas": {

0 commit comments

Comments
 (0)
0