Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3452

HTTP Documentation 'expected-response-type' is Required

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 4.1 M1
    • Component/s: Documentation
    • Labels:

      Description

      See the stack overflow question. If expected-response-type is not provided, or incompatible with the reply's content-type, a ResponseEntity with only headers and status is returned.

      A null response type ends up with a null delegate in the response extractor...

      	private class ResponseEntityResponseExtractor<T> implements ResponseExtractor<ResponseEntity<T>> {
      
      		private final HttpMessageConverterExtractor<T> delegate;
      
      		public ResponseEntityResponseExtractor(Type responseType) {
      			if (responseType != null && !Void.class.equals(responseType)) {
      				this.delegate = new HttpMessageConverterExtractor<T>(responseType, getMessageConverters(), logger);
      			} else {
      				this.delegate = null;
      			}
      		}
      
      		@Override
      		public ResponseEntity<T> extractData(ClientHttpResponse response) throws IOException {
      			if (this.delegate != null) {
      				T body = this.delegate.extractData(response);
      				return new ResponseEntity<T>(body, response.getHeaders(), response.getStatusCode());
      			}
      			else {
      				return new ResponseEntity<T>(response.getHeaders(), response.getStatusCode());
      			}
      		}
      	}
      

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            grussell Gary Russell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: