Hi Wes, I think the REST interface can only deal with PDX serialized objects, which is why you are seeing the behavior you are. There isn't a mechanism to introspect the Order object to pull out fields & values. PDX makes this easy since the serialized object is already stored that way.
On Thu, Jun 9, 2016 at 4:05 PM, Real Wes Williams <[email protected]> wrote: > > Is there any combination of settings where I can insert JSON objects into > GFSH and have them read via the REST API? All works well when I both put > and get via Swagger but I can’t put via Gfsh and get via Swagger due to Pdx > serialization. Is there a way to put JSON via GFSH such that it can be > read via the REST API? Or does it require a load program? > > *THIS DOES NOT WORK - Put JSON object via GFSH and Get via Swagger UI* > > gfsh> put —region=Orders --key=“AAPL" > --value=(“symbol”:"AAPL”,"shares”:"1000") > --value-class=io.pivotal.domain.Order > > This puts the Order into the Orders region as an Order and not as a > PdxInstanceImpl > > And then in the Swagger UI > GET http://192.168.0.3:7070/gemfire-api/v1/Orders/AAPL > > { "cause": "Could not write JSON: Requested data could not convert into > REST format[JSON] ; nested exception is > com.fasterxml.jackson.databind.JsonMappingException: Requested data could > not convert into REST format[JSON] “ } > > > > *THIS WORKS - Put JSON object via Swagger and Get via Swagger* > > POST http://192.168.0.3:7070/gemfire-api/v1/Orders?key=AAPL > > Value: {“symbol”:"AAPL”,"shares”:"1000"} > > This puts the Order into the Orders region as a PdxInstanceImpl and not as > an Order > > > GET http://192.168.0.3:7070/gemfire-api/v1/Orders/AAPL > > Response: > { “symbol": “AAPL", “shares": “1000 > } > > > -- *Mark Secrist | Sr Manager, **Global Education Delivery* [email protected] 970.214.4567 Mobile *pivotal.io <http://www.pivotal.io/>* Follow Us: Twitter <http://www.twitter.com/pivotal> | LinkedIn <http://www.linkedin.com/company/pivotalsoftware> | Facebook <http://www.facebook.com/pivotalsoftware> | YouTube <http://www.youtube.com/gopivotal> | Google+ <https://plus.google.com/105320112436428794490>
