Skip to content

Respect response status code set in MethodOutcome of a Resource provider #5268

Closed
@nathandoef

Description

@nathandoef

Describe the bug
The response status code set in a MethodOutcome of a Resource provider is not respected.

To Reproduce

  1. Register the custom Resource provider below:
public class ResponseCodeModifyingPatientProvider implements IResourceProvider {

	@Create()
	public MethodOutcome createPatient(@ResourceParam Patient thePatient, ServletRequest theServletRequest) {
		MethodOutcome methodOutcome = new MethodOutcome();
		methodOutcome.setResponseStatusCode(202);
		return methodOutcome;
	}

	@Override
	public Class<? extends IBaseResource> getResourceType() {
		return Patient.class;
	}
}
  1. Create a Patient resource using an IGenericClient
  2. Inspect the MethodOutcome
  3. See that the response status code is 0

Expected behavior
The response status code of the MethodOutcome should be 202 (i.e. the value set in the custom Resource provider).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions