Skip to content

Commit 965bc0b

Browse files
leak
1 parent b5c6e9c commit 965bc0b

5 files changed

Lines changed: 7 additions & 4 deletions

File tree

gateway-api/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ paths:
239239
type: string
240240
example: "Patient not found"
241241
'415':
242-
description: Unsupported Media Type"
242+
description: Unsupported Media Type - Content-Type header must be "application/fhir+json"
243243
content:
244244
application/fhir+json:
245245
schema:

gateway-api/src/gateway_api/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_structured_record() -> Response:
116116
log_error(e)
117117
response.add_error_response(e)
118118
except Exception:
119-
error = UnexpectedError(traceback=traceback.format_exc())
119+
error = UnexpectedError()
120120
log_error(error)
121121
response.add_error_response(error)
122122

gateway-api/src/gateway_api/get_structured_record/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, request: Request) -> None:
3737
self._headers = CaseInsensitiveDict(request.headers)
3838
self._validate_content_type()
3939
try:
40-
self.parameters = Parameters.model_validate(request.get_json())
40+
self.parameters = Parameters.model_validate(request.get_json(silent=True))
4141
except (BadRequest, ValidationError) as error:
4242
raise InvalidRequestJSONError() from error
4343

gateway-api/src/gateway_api/get_structured_record/test_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_add_provider_response_adds_200_status(
6262
assert actual == 200, f"Expected status code to be 200, but got {actual}"
6363

6464
def test_add_error_response_adds_error_response_body(self) -> None:
65-
error = UnexpectedError(traceback="something broke")
65+
error = UnexpectedError()
6666

6767
response = GetStructuredRecordResponse()
6868
response.add_error_response(error)

schemathesis.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ mode = "all"
33

44
[checks.missing_required_header]
55
expected-statuses = [400]
6+
7+
[checks.negative_data_rejection]
8+
expected-statuses = [400, 401, 403, 404, 406, 415, 422, 428, "5xx"]

0 commit comments

Comments
 (0)