title: Writing object with Spring Vault returns Status 400 : no data provided
body: <p>I am investigating how I can use Vault 0.11.1 and Spring Vault 2.0.2.RELEASE. I have set up a dev Vault:</p>
  
  <pre><code>vault server -dev
  </code></pre>
  
  <p>and added some data </p>
  
  <pre><code>vault kv put secret/certs/jan cert=ABCD
  </code></pre>
  
  <p>which I can read with Spring Vault</p>
  
  <pre><code>      @Autowired
        private VaultOperations operations;
  
              String path = "secret/data/certs/jan";
              System.out.println(operations.read(path).getData());
  </code></pre>
  
  <p>note that, curiously, I have to insert "data/" in the path to find it again.</p>
  
  <p>deleting the data works fine too:</p>
  
  <pre><code>            operations.delete(path);
  </code></pre>
  
  <p>but writing data with</p>
  
  <pre><code>            Secret secret = new Secret("ABCD");
              operations.write(path, secret);
  </code></pre>
  
  <p>fails with </p>
  
  <pre><code>org.springframework.vault.VaultException: Status 400 secret/data/certs/jan: no data provided
  </code></pre>
  
  <p>Secret is a simple bean:</p>
  
  <pre><code>@AllArgsConstructor
  @NoArgsConstructor
  @Data
  public class Secret {
      String cert;
  }
  </code></pre>
  
  <p>and the jason conversion seems to go fine:</p>
  
  <pre><code>DEBUG org.springframework.web.client.RestTemplate - Writing [Secret(cert=ABCD)] using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@add0edd]
  </code></pre>
  
  <p>Simply trying to write a String </p>
  
  <pre><code>            operations.write(path, "foo=bar");
  </code></pre>
  
  <p>also fails:</p>
  
  <pre><code>Status 400 secret/data/certs/jan: failed to parse JSON input: invalid character 'o' in literal false (expecting 'a')
  </code></pre>