microsoft / fhir-server

A service that implements the FHIR standard
MIT License
1.15k stars 490 forks source link

Bug 118017 - 500 due to InvalidCastException #3875

Closed v-ajajvanu closed 3 weeks ago

v-ajajvanu commented 1 month ago

Description

Made changes to fix the 500 internal server error issue when we pass payload other than Parameter resource type for Patch operation.

Related issue

Addresses [issue AB#118017].

Testing

PATCH request at URL Patient/123 with payload containing resource of type "Parameters". Result -> PATCH Operation succeeded, and attributes got updated.

PATCH request at URL Patient/123 with payload containing resource of type "Bundle". Result -> PATCH Operation failed, and status code of 400 Bad Request is returned.

Also, tested other HTTP operations like GET, POST, PUT and DELETE on Patient resource to see everything works as expected.

FHIR Team Checklist

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

v-ajajvanu commented 1 month ago

Can you please add a test for this scenario?

@abiisnn We had added test cases for the changes made to fix the 500 due to InvalidCastException issue. If possible, could you please review the same.

mikaelweave commented 1 month ago

/azp run

azure-pipelines[bot] commented 1 month ago
Azure Pipelines successfully started running 1 pipeline(s).
mikaelweave commented 1 month ago

/azp run

azure-pipelines[bot] commented 1 month ago
Azure Pipelines successfully started running 1 pipeline(s).
mikaelweave commented 1 month ago

/azp run

azure-pipelines[bot] commented 1 month ago
Azure Pipelines successfully started running 1 pipeline(s).
mikaelweave commented 3 weeks ago

Closing as #3906 merged this code