Issue
I have a JSON name value pair which I would like to convert to a Java object.
The JSON is as follows
{
"x5t#S256": "vaule",
}
The below does not work because of illegal character
public class Key {
@JsonProperty
private String x5t#S256;
}
As you might guess this has to do with JWKS sets, but that's not relevant for now. It seems like quite straightforward question, but I have not been able to find anything on google.
Solution
You can pass the original name into the annotation, and give a different name to your attribute, for example:
@JsonProperty("x5t#S256")
private String differentName;
Answered By - Youcef Laidani
Answer Checked By - Robin (JavaFixing Admin)