# Annotation Type JsonString (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.JsonString)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.json.JsonString)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.json.JsonString)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.json.JsonString)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.json.JsonString)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.json.JsonString)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.json.JsonString)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.json.JsonString)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.json.JsonString)

    public interface JsonString implements Annotation

Use this annotation to specify that a declared numeric Java field should map to a JSON string.

By default declared Java numeric fields are stored as JSON numbers. For example:

     
     class A {
     @Key BigInteger value;
     }
     
     
can be used for this JSON content:

     
     {"value" : 12345768901234576890123457689012345768901234576890}
     
     
However, if instead the JSON content uses a JSON String to store the value, one needs to use
the [JsonString](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.JsonString) annotation. For example:

     
     class B {
     @Key @JsonString BigInteger value;
     }
     
     
can be used for this JSON content:

     
     {"value" : "12345768901234576890123457689012345768901234576890"}
     
     
## Implements

[Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html)