{"action":"created","issue":{"url":"https://api.github.com/repos/confluentinc/schema-registry/issues/686","repository_url":"https://api.github.com/repos/confluentinc/schema-registry","labels_url":"https://api.github.com/repos/confluentinc/schema-registry/issues/686/labels{/name}","comments_url":"https://api.github.com/repos/confluentinc/schema-registry/issues/686/comments","events_url":"https://api.github.com/repos/confluentinc/schema-registry/issues/686/events","html_url":"https://github.com/confluentinc/schema-registry/pull/686","id":280612179,"number":686,"title":"issue#629: endpoint to return schema literal","user":{"login":"sjdurfey","id":36726,"avatar_url":"https://avatars1.githubusercontent.com/u/36726?v=4","gravatar_id":"","url":"https://api.github.com/users/sjdurfey","html_url":"https://github.com/sjdurfey","followers_url":"https://api.github.com/users/sjdurfey/followers","following_url":"https://api.github.com/users/sjdurfey/following{/other_user}","gists_url":"https://api.github.com/users/sjdurfey/gists{/gist_id}","starred_url":"https://api.github.com/users/sjdurfey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjdurfey/subscriptions","organizations_url":"https://api.github.com/users/sjdurfey/orgs","repos_url":"https://api.github.com/users/sjdurfey/repos","events_url":"https://api.github.com/users/sjdurfey/events{/privacy}","received_events_url":"https://api.github.com/users/sjdurfey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2017-12-08T20:46:20Z","updated_at":"2017-12-19T03:38:54Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/confluentinc/schema-registry/pulls/686","html_url":"https://github.com/confluentinc/schema-registry/pull/686","diff_url":"https://github.com/confluentinc/schema-registry/pull/686.diff","patch_url":"https://github.com/confluentinc/schema-registry/pull/686.patch"},"body":"PR for #629 & #381 \r\n\r\nThis PR is to create an endpoint to return the avro schema as a string literal for integration with Hive.  \r\n\r\nI ran into an issue where the String being returned was fine with Hive, but the ObjectMapper used in the RestService#sendHttpRequest assumes every payload returned is a json object. The object mapper wasn't able to correctly parse the returned String. Because it couldn't be escaped the json parser interpreted the contents as being a json response, but was using the StringDeserializer, which couldn't handle it. I just wound up with these exceptions:\r\n```\r\ncom.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token\r\n at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@65bdd558; line: 1, column: 1]\r\n\tat com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270)\r\n\tat com.fasterxml.jackson.databind.DeserializationContext.reportMappingException(DeserializationContext.java:1234)\r\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1122)\r\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1075)\r\n```\r\nIf I escaped the returned string, then the object mapper was happy but would break Hive. So, I went with checking the content type and if it is `text/plain` to just read it as a string and bypass the object mapper. I'm open to other ideas if there is a better way to handle this.  "},"comment":{"url":"https://api.github.com/repos/confluentinc/schema-registry/issues/comments/352630744","html_url":"https://github.com/confluentinc/schema-registry/pull/686#issuecomment-352630744","issue_url":"https://api.github.com/repos/confluentinc/schema-registry/issues/686","id":352630744,"user":{"login":"mageshn","id":7535516,"avatar_url":"https://avatars3.githubusercontent.com/u/7535516?v=4","gravatar_id":"","url":"https://api.github.com/users/mageshn","html_url":"https://github.com/mageshn","followers_url":"https://api.github.com/users/mageshn/followers","following_url":"https://api.github.com/users/mageshn/following{/other_user}","gists_url":"https://api.github.com/users/mageshn/gists{/gist_id}","starred_url":"https://api.github.com/users/mageshn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mageshn/subscriptions","organizations_url":"https://api.github.com/users/mageshn/orgs","repos_url":"https://api.github.com/users/mageshn/repos","events_url":"https://api.github.com/users/mageshn/events{/privacy}","received_events_url":"https://api.github.com/users/mageshn/received_events","type":"User","site_admin":false},"created_at":"2017-12-19T03:38:54Z","updated_at":"2017-12-19T03:38:54Z","author_association":"MEMBER","body":"@sjdurfey has been a busy week, will take a final pass in the next couple of days."}}
{"actor":{"display_login":"mageshn"}}