Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0.0.M1
    • Component/s: rest-template
    • Labels:
      None

      Description

      Merge in changes from SPR-7023 to support generic types in RestTemplate.

        Activity

        Hide
        Daniel Garcia added a comment -

        I really want to see this issue resolved... :|

        Show
        Daniel Garcia added a comment - I really want to see this issue resolved... :|
        Hide
        David Harrigan added a comment -

        It's become nearly impossible now to use RestTemplate especially if using Spring Hateoas. We need the ability to use <Resources> and <Resource> as types when parsing the returned JSON from an API that uses Spring Hateoas to return JSON.

        Please can this be considered for an early inclusion in the next release.

        Thank you.

        =david=

        Show
        David Harrigan added a comment - It's become nearly impossible now to use RestTemplate especially if using Spring Hateoas. We need the ability to use <Resources> and <Resource> as types when parsing the returned JSON from an API that uses Spring Hateoas to return JSON. Please can this be considered for an early inclusion in the next release. Thank you. =david=
        Hide
        Roy Clarkson added a comment -

        Commit 7134c1d790fadf8e331fdfcb6c6498854a894444

        This change makes it possible to use the RestTemplate to read an HTTP
        response into a target generic type object. The RestTemplate has three
        new exchange() methods that accept ParameterizedTypeReference -- a
        new class that enables capturing and passing generic type info.
        See the Javadoc of the three new methods in RestOperations for a
        short example.
         
        To support this feature, the HttpMessageConverter is now extended by
        GenericHttpMessageConverter, which adds a method for reading an
        HttpInputMessage to a specific generic type. The new interface
        is implemented by the MappingJacksonHttpMessageConverter and
        MappingJackson2HttpMessageConverter.
        

        Show
        Roy Clarkson added a comment - Commit 7134c1d790fadf8e331fdfcb6c6498854a894444 This change makes it possible to use the RestTemplate to read an HTTP response into a target generic type object. The RestTemplate has three new exchange() methods that accept ParameterizedTypeReference -- a new class that enables capturing and passing generic type info. See the Javadoc of the three new methods in RestOperations for a short example.   To support this feature, the HttpMessageConverter is now extended by GenericHttpMessageConverter, which adds a method for reading an HttpInputMessage to a specific generic type. The new interface is implemented by the MappingJacksonHttpMessageConverter and MappingJackson2HttpMessageConverter.

          People

          • Assignee:
            Roy Clarkson
            Reporter:
            Roy Clarkson
          • Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: