Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ CHANGELOG
* **BREAKING:** Java 11 support has been dropped. Java 17 or later is now required.
* **BREAKING:** Removed explicit `serialVersionUID` from all exception classes.
Java will auto-generate serialVersionUID when needed, following modern practices.
* **BREAKING:** Removed no longer necessary `JacksonInject` annotations for
`ip_address`, `network`, and `traits` from several classes. The
`JsonInjector` class was removed.

4.4.0 (2025-08-28)
------------------
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/com/maxmind/geoip2/JsonInjector.java

This file was deleted.

3 changes: 2 additions & 1 deletion src/main/java/com/maxmind/geoip2/WebServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ private <T> T handleResponse(HttpResponse<InputStream> response, Class<T> cls)
+ status + ") for " + uri, status, uri);
}

InjectableValues inject = new JsonInjector(locales, null, null);
InjectableValues inject = new InjectableValues.Std()
.addValue("locales", locales);

try {
return mapper.readerFor(cls).with(inject).readValue(response.body());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class AnonymousIpResponse extends IpBaseResponse {
* @param network the network associated with the record
*/
public AnonymousIpResponse(
@JacksonInject("ip_address") @JsonProperty("ip_address") String ipAddress,
@JsonProperty("ip_address") String ipAddress,
@JsonProperty("is_anonymous") boolean isAnonymous,
@JsonProperty("is_anonymous_vpn") boolean isAnonymousVpn,
@JsonProperty("is_hosting_provider") boolean isHostingProvider,
@JsonProperty("is_public_proxy") boolean isPublicProxy,
@JsonProperty("is_residential_proxy") boolean isResidentialProxy,
@JsonProperty("is_tor_exit_node") boolean isTorExitNode,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) Network network
) {
super(ipAddress, isAnonymous, isAnonymousVpn, isHostingProvider, isPublicProxy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public class AnonymousPlusResponse extends AnonymousIpResponse {
*/
public AnonymousPlusResponse(
@JsonProperty("anonymizer_confidence") Integer anonymizerConfidence,
@JacksonInject("ip_address") @JsonProperty("ip_address") String ipAddress,
@JsonProperty("ip_address") String ipAddress,
@JsonProperty("is_anonymous") Boolean isAnonymous,
@JsonProperty("is_anonymous_vpn") Boolean isAnonymousVpn,
@JsonProperty("is_hosting_provider") Boolean isHostingProvider,
@JsonProperty("is_public_proxy") Boolean isPublicProxy,
@JsonProperty("is_residential_proxy") Boolean isResidentialProxy,
@JsonProperty("is_tor_exit_node") Boolean isTorExitNode,
@JacksonInject("network") @JsonDeserialize(using = NetworkDeserializer.class)
@JsonDeserialize(using = NetworkDeserializer.class)
@JsonProperty("network") Network network,
@JsonProperty("network_last_seen") LocalDate networkLastSeen,
@JsonProperty("provider_name") String providerName
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/maxmind/geoip2/model/AsnResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public AsnResponse(
@JsonProperty("autonomous_system_organization")
@MaxMindDbParameter(name = "autonomous_system_organization")
String autonomousSystemOrganization,
@JacksonInject("ip_address") @JsonProperty("ip_address")
@JsonProperty("ip_address")
@MaxMindDbParameter(name = "ip_address") String ipAddress,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) @MaxMindDbParameter(name = "network")
Network network
) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/maxmind/geoip2/model/CityResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public CityResponse(
RepresentedCountry representedCountry,
@JsonProperty("subdivisions") @MaxMindDbParameter(name = "subdivisions")
ArrayList<Subdivision> subdivisions,
@JacksonInject("traits") @JsonProperty("traits") @MaxMindDbParameter(name = "traits")
@JsonProperty("traits") @MaxMindDbParameter(name = "traits")
Traits traits
) {
super(city, continent, country, location, maxmind, postal, registeredCountry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public static ConnectionType fromString(String s) {
*/
public ConnectionTypeResponse(
@JsonProperty("connection_type") ConnectionType connectionType,
@JacksonInject("ip_address") @JsonProperty("ip_address") String ipAddress,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("ip_address") String ipAddress,
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) Network network
) {
this.connectionType = connectionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public CountryResponse(
Country registeredCountry,
@JsonProperty("represented_country") @MaxMindDbParameter(name = "represented_country")
RepresentedCountry representedCountry,
@JacksonInject("traits") @JsonProperty("traits") @MaxMindDbParameter(name = "traits")
@JsonProperty("traits") @MaxMindDbParameter(name = "traits")
Traits traits
) {
super(continent, country, maxmind, registeredCountry, representedCountry, traits);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/maxmind/geoip2/model/DomainResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public class DomainResponse extends AbstractResponse {
@MaxMindDbConstructor
public DomainResponse(
@JsonProperty("domain") @MaxMindDbParameter(name = "domain") String domain,
@JacksonInject("ip_address") @JsonProperty("ip_address")
@JsonProperty("ip_address")
@MaxMindDbParameter(name = "ip_address") String ipAddress,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) @MaxMindDbParameter(name = "network")
Network network
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public EnterpriseResponse(
RepresentedCountry representedCountry,
@JsonProperty("subdivisions") @MaxMindDbParameter(name = "subdivisions")
ArrayList<Subdivision> subdivisions,
@JacksonInject("traits") @JsonProperty("traits") @MaxMindDbParameter(name = "traits")
@JsonProperty("traits") @MaxMindDbParameter(name = "traits")
Traits traits
) {
super(city, continent, country, location, maxmind, postal, registeredCountry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public InsightsResponse(
@JsonProperty("registered_country") Country registeredCountry,
@JsonProperty("represented_country") RepresentedCountry representedCountry,
@JsonProperty("subdivisions") List<Subdivision> subdivisions,
@JacksonInject("traits") @JsonProperty("traits") Traits traits
@JsonProperty("traits") Traits traits
) {
super(city, continent, country, location, maxmind, postal, registeredCountry,
representedCountry, subdivisions, traits);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/maxmind/geoip2/model/IpRiskResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public class IpRiskResponse extends IpBaseResponse {
* @param ipRisk the IP risk of a model
*/
public IpRiskResponse(
@JacksonInject("ip_address") @JsonProperty("ip_address") String ipAddress,
@JsonProperty("ip_address") String ipAddress,
@JsonProperty("is_anonymous") boolean isAnonymous,
@JsonProperty("is_anonymous_vpn") boolean isAnonymousVpn,
@JsonProperty("is_hosting_provider") boolean isHostingProvider,
@JsonProperty("is_public_proxy") boolean isPublicProxy,
@JsonProperty("is_residential_proxy") boolean isResidentialProxy,
@JsonProperty("is_tor_exit_node") boolean isTorExitNode,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) Network network,
@JsonProperty("ip_risk") double ipRisk
) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/maxmind/geoip2/model/IspResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public IspResponse(
@JsonProperty("autonomous_system_organization")
@MaxMindDbParameter(name = "autonomous_system_organization")
String autonomousSystemOrganization,
@JacksonInject("ip_address") @JsonProperty("ip_address")
@JsonProperty("ip_address")
@MaxMindDbParameter(name = "ip_address") String ipAddress,
@JsonProperty("isp") @MaxMindDbParameter(name = "isp") String isp,
@JsonProperty("mobile_country_code") @MaxMindDbParameter(name = "mobile_country_code")
Expand All @@ -49,7 +49,7 @@ public IspResponse(
String mobileNetworkCode,
@JsonProperty("organization") @MaxMindDbParameter(name = "organization")
String organization,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) @MaxMindDbParameter(name = "network")
Network network
) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/maxmind/geoip2/record/Traits.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Traits(
@JsonProperty("autonomous_system_organization") String autonomousSystemOrganization,
@JsonProperty("connection_type") ConnectionType connectionType,
@JsonProperty("domain") String domain,
@JacksonInject("ip_address") @JsonProperty("ip_address") String ipAddress,
@JsonProperty("ip_address") String ipAddress,
@JsonProperty("is_anonymous") boolean isAnonymous,
@JsonProperty("is_anonymous_vpn") boolean isAnonymousVpn,
@JsonProperty("is_anycast") boolean isAnycast,
Expand All @@ -103,7 +103,7 @@ public Traits(
@JsonProperty("isp") String isp,
@JsonProperty("mobile_country_code") String mobileCountryCode,
@JsonProperty("mobile_network_code") String mobileNetworkCode,
@JacksonInject("network") @JsonProperty("network")
@JsonProperty("network")
@JsonDeserialize(using = NetworkDeserializer.class) Network network,
@JsonProperty("organization") String organization,
@JsonProperty("user_type") String userType,
Expand Down
Loading