title: Deserialize JSON to string in raw format using Jackson
body: <p>I have a use case where I want the JSON to be converted to string as it is, but it is failing and giving me null, here is my POJO: </p>
  
  <pre><code>@Data
  @JsonSnakeCase
  @JsonIgnoreProperties(ignoreUnknown = true)
  public class DocumentTemplateRequest {
  
  @Enumerated(EnumType.STRING)
  private TemplateState state;
  
  
  @JsonDeserialize(using = JsonAsStringDeserializer.class)
  private String inputSchema;
  
  }
  </code></pre>
  
  <p>the Json I am using as payload:</p>
  
  <pre><code>{
  "state": "staging",
  "input_schema": {
      "title": "Person",
      "type": "object",
      "properties": {
          "firstName": {
              "type": "string"
          },
          "lastName": {
              "type": "string"
          }
      },
      "required": ["firstName", "lastName"]
  }
  
  }
  </code></pre>
  
  <p>I am using object mapper for mappings:</p>
  
  <pre><code>    ObjectMapper objectMapper = new ObjectMapper();
      DocumentTemplateRequest documentTemplateRequest = null;
      try {
          documentTemplateRequest = objectMapper.readValue(str, DocumentTemplateRequest.class);
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>and here is my deserializer:</p>
  
  <pre><code>public class JsonAsStringDeserializer extends JsonDeserializer&lt;String&gt; {
  @Override
  public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
      TreeNode tree = jsonParser.getCodec().readTree(jsonParser);
      return tree.toString();
  
  }
  }
  </code></pre>
  
  <p>and the results of deserialization is :</p>
  
  <pre><code>state : staging
  inputSchema: null
  </code></pre>
  
  <p>why inputSchema is coming as null, what am I missing?</p>