Hi Paul,
Sorry for not responding to this sooner.
Sadly what you've hit upon is expected behaviour, as far as HalBuilder is (currently) concerned.
Originally I wrote the library with roundtripping of JSON/XML in mind, and thus was only supporting simple key/value properties, however as people actually started using the library, and very few people seem to care about the XML variant or round-tripping support, I broke up the library into separate artefacts for the various representation formats and have taken..... liberties with how the underlying Jackson is configured to allow the serialisation of nested/complex objects, but as yet not not looked at the reading side of things.
On the reading side - I also have the "render as java interface" which was novel, from a simple API perspective but also kinda horrible.
For a while I've known I've needed to address this, but as yet haven't a) had the time or b) personal need - but as more and more people seem to be wanting it, I think I need to act - I've had a few pull requests over the last year that attempt to implement support for it, but also break things as far as the interface-rendering goes.
I've been thinking about ways around this for awhile - and think the following approach might be a good way forward:
In theory - these changes shouldn't actually take that long to do as its just moving a few things around internally.
Thoughts?
On 12 Mar 2014, at 2:01, Paul Cox wrote:
Hi Mark,
I'm trying to use your java halbuilder and I'm having a problem:
When I build a readable representation based on a hal response like below,
I get null in the properties field for test.String string3 = "{\"_links\":[],\"test\":{\"testing\":\"testing2\"}}";
Am I doing something wrong, is it a bug, or is it actually expected
behaviour?I appreciate any help you can give.
Cheers,
Paulp.s. the actual code is
RepresentationFactory representationFactory = new
DefaultRepresentationFactory().withReader(RepresentationFactory.HAL_JSON,
JsonRepresentationReader.class);ReadableRepresentation readableRepresentation =
representationFactory.readRepresentation(new StringReader(string3));