Hi,
I get a funny error whenever I try POSTing an encounter with an obsGroup
via rest. Below is a demo request body:
{
"patient": "76761b1f-729b-45c9-82e1-f4a8eee1957a",
"encounterDatetime": "2021-10-08T10:08:45.259Z",
"location": "28066518-a0e5-4331-b23e-7b40f96d733a",
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe",
"encounterProviders": [
{
"provider": "82252c2a-3d17-48c0-a739-881ba41d3341",
"encounterRole": "240b26f9-dd88-4172-823d-4a8bfeb7841f"
}
],
"obs": [
{
"person": "76761b1f-729b-45c9-82e1-f4a8eee1957a",
"obsDatetime": "2021-10-08T10:08:45.259Z",
"concept": "8acba1d1-67cc-422c-961e-86d6b47bc45b",
"location": "28066518-a0e5-4331-b23e-7b40f96d733a",
"groupMembers": [
{
"person": "76761b1f-729b-45c9-82e1-f4a8eee1957a",
"obsDatetime": "2021-10-08T10:08:45.259Z",
"concept": "d3205b6a-7192-461f-9ea8-a1ac8af38964",
"location": "28066518-a0e5-4331-b23e-7b40f96d733a",
"value": 100
}
],
"voided": false
}
]
}
Error in response (Full server log)
om.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.openmrs.module.webservices.validation.ValidationException["errors"]->org.springframework.validation.BindException["bindingResult"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"])
com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277)
com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71)
com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1516)
com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1006)
org.springframework.web.servlet.view.json.AbstractJackson2View.writeContent(AbstractJackson2View.java:228)
org.springframework.web.servlet.view.json.AbstractJackson2View.renderMergedOutputModel(AbstractJackson2View.java:172)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1373)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1118)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1057)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:60)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73)
org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:65)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:105)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:106)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:93)
org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:61)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.spa.filter.SpaFilter.doFilter(SpaFilter.java:53)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57)
org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:105)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:156)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108)
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108)
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
Server Props:
- Platform:
2.4.0
- Rest Web Services:
2.32.0-SNAPSHOT.2601f8
Is my request payload malformed?