question: protected RamlResponse extractResponseFromMethod ( Method method , String responseComment ) { RamlModelFactory ramlModelFactory = RamlModelFactoryOfFactories . createRamlModelFactory ( ) ; RamlResponse response = ramlModelFactory . createRamlResponse ( ) ; String mime = extractMimeTypeFromMethod ( method ) ; RamlMimeType jsonType = ramlModelFactory . createRamlMimeTypeWithMime ( mime ) ; Class < ? > returnType = method . getReturnType ( ) ; Type genericReturnType = method . getGenericReturnType ( ) ; Type inferGenericType = TypeHelper . inferGenericType ( genericReturnType ) ; if ( returnType != null && ( returnType . equals ( DeferredResult . class ) || returnType . equals ( ResponseEntity . class ) ) ) { if ( inferGenericType == null ) { inferGenericType = Object . class ; } if ( inferGenericType instanceof Class ) { returnType = ( Class < ? > ) inferGenericType ; } genericReturnType = inferGenericType ; } jsonType . setSchema ( SchemaHelper . convertClassToJsonSchema ( genericReturnType , responseComment , javaDocs . getJavaDoc ( returnType ) ) ) ; LinkedHashMap < String , RamlMimeType > body = new LinkedHashMap < > ( ) ; body . put ( mime , jsonType ) ; response . setBody ( body ) ; if ( StringUtils . hasText ( responseComment ) ) { response . setDescription ( responseComment ) ; } else { response . setDescription ( "Successful Response" ) ; } return response ; }
target:  Extracts the Response Body from a method in JsonSchema Format and embeds it into a response object based on the defaultMediaType