Skip to content

Commit a071b4f

Browse files
committed
fix: Don't serialize null values in JWK.
1 parent 319835d commit a071b4f

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/com/danubetech/keyformats/jose

1 file changed

+2
-1
lines changed

src/main/java/com/danubetech/keyformats/jose/JWK.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.danubetech.keyformats.jose;
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
45
import com.fasterxml.jackson.core.JsonProcessingException;
56
import com.fasterxml.jackson.databind.ObjectMapper;
67
import org.apache.commons.codec.binary.Base64;
@@ -30,7 +31,7 @@ public JWK() {
3031
* Serialization
3132
*/
3233

33-
private static final ObjectMapper objectMapper = new ObjectMapper();
34+
private static final ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
3435

3536
public static JWK fromJson(String json) throws IOException {
3637
return objectMapper.readValue(json, JWK.class);

0 commit comments

Comments
 (0)