title: Can't get HAL rendering with Spring HATEOAS and Jersey
body: <p>I used the Spring Initializr (<a href="https://start.spring.io/" rel="nofollow">https://start.spring.io/</a> ) to create an app with only starters "Jersey (JAX-RS)" and "HATEOAS".
  Then I added @EnableHypermediaSupport(type = HAL), but I just can't get links rendered correctly in HAL format.</p>
  
  <p>The format I aim for:</p>
  
  <pre><code>{
      "name": "Hello",
      "count": 42,
      "_links": {
          "self": {
              "href": "http://localhost:8080/api/foo"
          }
      }
  }
  </code></pre>
  
  <p>What I currently get instead:</p>
  
  <pre><code>{
      "name": "Hello",
      "count": 42,
      "links": [
          {
              "rel": "self",
              "href": "http://localhost:8080/api/foo"
          }
      ]
  }
  </code></pre>
  
  <p>Besides the classes generated by the initializr, I added this configuration</p>
  
  <pre><code>@Configuration
  @ApplicationPath("api")
  @Component
  @EnableHypermediaSupport(type = HAL)
  public class JerseyConfig extends ResourceConfig {
      public JerseyConfig() {
          registerEndpoints();
      }
  
      private void registerEndpoints() {
          register(FooResource.class);
      }
  }
  </code></pre>
  
  <p>this resource (endpoint):</p>
  
  <pre><code>@Component
  @Path("foo")
  public class FooResource {
  
      @GET
      @Produces(MediaTypes.HAL_JSON_VALUE)
      public Resource&lt;Foo&gt; getFoo() {
  
          final Resource&lt;Foo&gt; fooTo = new Resource&lt;&gt;(new Foo("Hello", 42));
  
          fooTo.add(JaxRsLinkBuilder.linkTo(FooResource.class).withRel("self"));
  
          return fooTo;
      }
  }
  </code></pre>
  
  <p>and a dummy bean:</p>
  
  <pre><code>public class Foo {
      private String name;
      private int count;
  
      public Foo() {
      }
  
      public Foo(String name, int count) {
          this.name = name;
          this.count = count;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public int getCount() {
          return count;
      }
  
      public void setCount(int count) {
          this.count = count;
      }
  }
  </code></pre>
  
  <p>I also tried adding</p>
  
  <pre><code>@EnableHypermediaSupport(type = HAL)
  </code></pre>
  
  <p>next to the @SpringBootApplication on the application class.</p>
  
  <p>When I </p>
  
  <pre><code>GET localhost:8080/api/foo
  </code></pre>
  
  <p>I get a response with correct content type</p>
  
  <pre><code>application/hal+json;charset=UTF-8
  </code></pre>
  
  <p>but still the wrong format ("link" property as array instaed of "_links" property as object/map).</p>