Skip to content

Commit

Permalink
upgraded dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lpandzic committed Oct 11, 2023
1 parent c3a2fed commit 751323d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ static class LowerUnderscorePresentPropertyJsonTypeResolver<E extends Enum<E> &
}
}
```
Then your model may look as follows (note that there's a [bug](https://github.com/FasterXML/jackson-databind/issues/2992) with @JsonNaming and records in jackson):
Then your model may look as follows:
```java
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonTypeResolveWith(LowerUnderscorePresentPropertyJsonTypeResolver.class)
interface Bike extends PresentPropertyJsonHierarchy<BikeType> {

Expand All @@ -267,11 +268,11 @@ static class LowerUnderscorePresentPropertyJsonTypeResolver<E extends Enum<E> &
}
}

record RoadBike(@JsonProperty("road_bike") String roadBike) implements Bike {
record RoadBike(String roadBike) implements Bike {

}

record MountainBike(@JsonProperty("mountain_bike") String mountainBike) implements Bike {
record MountainBike(String mountainBike) implements Bike {

}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package com.infobip.jackson;

import static org.assertj.core.api.BDDAssertions.then;

import java.util.Arrays;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.google.common.base.CaseFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.List;

import static org.assertj.core.api.BDDAssertions.then;

@AllArgsConstructor
class PresentPropertyCaseFormatDeserializerTest extends TestBase {

Expand Down Expand Up @@ -102,6 +103,7 @@ void shouldDeserializeRoadBikeAsRoadBikeFromJson() throws JsonProcessingExceptio
then(actual).isEqualTo(new RoadBike("road bike"));
}

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonTypeResolveWith(LowerUnderscorePresentPropertyJsonTypeResolver.class)
interface Bike extends PresentPropertyJsonHierarchy<BikeType> {

Expand All @@ -115,11 +117,11 @@ public LowerUnderscorePresentPropertyJsonTypeResolver(Class<E> type) {
}
}

record RoadBike(@JsonProperty("road_bike") String roadBike) implements Bike {
record RoadBike(String roadBike) implements Bike {

}

record MountainBike(@JsonProperty("mountain_bike") String mountainBike) implements Bike {
record MountainBike(String mountainBike) implements Bike {

}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

<properties>
<!-- DEPENDENCY VERSIONS -->
<spring-boot.version>3.0.0</spring-boot.version>
<spring-boot.version>3.1.2</spring-boot.version>

<!-- PLUGIN VERSIONS -->
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
Expand Down

0 comments on commit 751323d

Please sign in to comment.