From 700fa96e179be9f005466606887c8f8a6d832fc9 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Mon, 4 Mar 2024 11:46:38 +0100 Subject: [PATCH] feat: change `url` field format to String BREAKING CHANGE: change `url` field type from URI to String --- docs/ProductsResponseIdentificationData.md | 2 +- docs/ResponseVisits.md | 2 +- docs/Visit.md | 2 +- docs/WebhookVisit.md | 2 +- res/fingerprint-server-api.yaml | 5 ----- .../model/ProductsResponseIdentificationData.java | 9 ++++----- src/main/java/com/fingerprint/model/ResponseVisits.java | 9 ++++----- src/main/java/com/fingerprint/model/Visit.java | 9 ++++----- src/main/java/com/fingerprint/model/WebhookVisit.java | 9 ++++----- src/test/resources/mocks/get_event_200.json | 4 ++-- 10 files changed, 22 insertions(+), 31 deletions(-) diff --git a/docs/ProductsResponseIdentificationData.md b/docs/ProductsResponseIdentificationData.md index a96a811..169c35b 100644 --- a/docs/ProductsResponseIdentificationData.md +++ b/docs/ProductsResponseIdentificationData.md @@ -14,7 +14,7 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which the identification request was sent. | | +|**url** | **String** | Page URL from which the identification request was sent. | | |**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | |**confidence** | [**Confidence**](Confidence.md) | | [optional] | diff --git a/docs/ResponseVisits.md b/docs/ResponseVisits.md index 0465daa..42707f1 100644 --- a/docs/ResponseVisits.md +++ b/docs/ResponseVisits.md @@ -14,7 +14,7 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which the identification request was sent. | | +|**url** | **String** | Page URL from which the identification request was sent. | | |**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | |**confidence** | [**Confidence**](Confidence.md) | | [optional] | diff --git a/docs/Visit.md b/docs/Visit.md index 09fa664..aac5e07 100644 --- a/docs/Visit.md +++ b/docs/Visit.md @@ -14,7 +14,7 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which the identification request was sent. | | +|**url** | **String** | Page URL from which the identification request was sent. | | |**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | |**confidence** | [**Confidence**](Confidence.md) | | [optional] | diff --git a/docs/WebhookVisit.md b/docs/WebhookVisit.md index 4965069..739613d 100644 --- a/docs/WebhookVisit.md +++ b/docs/WebhookVisit.md @@ -36,7 +36,7 @@ |**ipLocation** | [**DeprecatedIPLocation**](DeprecatedIPLocation.md) | | [optional] | |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | | -|**url** | **URI** | Page URL from which the identification request was sent. | | +|**url** | **String** | Page URL from which the identification request was sent. | | |**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | | |**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] | |**confidence** | [**Confidence**](Confidence.md) | | [optional] | diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index e2843c4..792ce04 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -491,7 +491,6 @@ components: url: description: Page URL from which the identification request was sent. type: string - format: uri example: https://some.website/path?query=params tag: description: >- @@ -747,7 +746,6 @@ components: url: description: Page URL from which the identification request was sent. type: string - format: uri example: https://some.website/path?query=params tag: description: >- @@ -861,7 +859,6 @@ components: url: description: Page URL from which the identification request was sent. type: string - format: uri example: https://some.website/path?query=params tag: description: >- @@ -1164,7 +1161,6 @@ components: url: description: Page URL from which the identification request was sent. type: string - format: uri example: https://some.website/path?query=params tag: description: >- @@ -1447,7 +1443,6 @@ components: url: description: Page URL from which identification request was sent. type: string - format: uri-reference example: https://example.com/login userAgent: type: string diff --git a/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java b/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java index 1b683c4..0afd14b 100644 --- a/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java +++ b/src/main/java/com/fingerprint/model/ProductsResponseIdentificationData.java @@ -28,7 +28,6 @@ import com.fingerprint.model.SeenAt; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.net.URI; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -80,7 +79,7 @@ public class ProductsResponseIdentificationData { private OffsetDateTime time; public static final String JSON_PROPERTY_URL = "url"; - private URI url; + private String url; public static final String JSON_PROPERTY_TAG = "tag"; private Map tag = new HashMap<>(); @@ -290,7 +289,7 @@ public void setTime(OffsetDateTime time) { } - public ProductsResponseIdentificationData url(URI url) { + public ProductsResponseIdentificationData url(String url) { this.url = url; return this; } @@ -304,14 +303,14 @@ public ProductsResponseIdentificationData url(URI url) { @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public URI getUrl() { + public String getUrl() { return url; } @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUrl(URI url) { + public void setUrl(String url) { this.url = url; } diff --git a/src/main/java/com/fingerprint/model/ResponseVisits.java b/src/main/java/com/fingerprint/model/ResponseVisits.java index 8070602..6122c1e 100644 --- a/src/main/java/com/fingerprint/model/ResponseVisits.java +++ b/src/main/java/com/fingerprint/model/ResponseVisits.java @@ -28,7 +28,6 @@ import com.fingerprint.model.SeenAt; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.net.URI; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -79,7 +78,7 @@ public class ResponseVisits { private OffsetDateTime time; public static final String JSON_PROPERTY_URL = "url"; - private URI url; + private String url; public static final String JSON_PROPERTY_TAG = "tag"; private Map tag = new HashMap<>(); @@ -286,7 +285,7 @@ public void setTime(OffsetDateTime time) { } - public ResponseVisits url(URI url) { + public ResponseVisits url(String url) { this.url = url; return this; } @@ -300,14 +299,14 @@ public ResponseVisits url(URI url) { @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public URI getUrl() { + public String getUrl() { return url; } @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUrl(URI url) { + public void setUrl(String url) { this.url = url; } diff --git a/src/main/java/com/fingerprint/model/Visit.java b/src/main/java/com/fingerprint/model/Visit.java index 32bd23d..a7ec884 100644 --- a/src/main/java/com/fingerprint/model/Visit.java +++ b/src/main/java/com/fingerprint/model/Visit.java @@ -28,7 +28,6 @@ import com.fingerprint.model.SeenAt; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.net.URI; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -79,7 +78,7 @@ public class Visit { private OffsetDateTime time; public static final String JSON_PROPERTY_URL = "url"; - private URI url; + private String url; public static final String JSON_PROPERTY_TAG = "tag"; private Map tag = new HashMap<>(); @@ -286,7 +285,7 @@ public void setTime(OffsetDateTime time) { } - public Visit url(URI url) { + public Visit url(String url) { this.url = url; return this; } @@ -300,14 +299,14 @@ public Visit url(URI url) { @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public URI getUrl() { + public String getUrl() { return url; } @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUrl(URI url) { + public void setUrl(String url) { this.url = url; } diff --git a/src/main/java/com/fingerprint/model/WebhookVisit.java b/src/main/java/com/fingerprint/model/WebhookVisit.java index 21dde8e..befbcc0 100644 --- a/src/main/java/com/fingerprint/model/WebhookVisit.java +++ b/src/main/java/com/fingerprint/model/WebhookVisit.java @@ -47,7 +47,6 @@ import com.fingerprint.model.VpnResult; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.net.URI; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -186,7 +185,7 @@ public class WebhookVisit { private OffsetDateTime time; public static final String JSON_PROPERTY_URL = "url"; - private URI url; + private String url; public static final String JSON_PROPERTY_TAG = "tag"; private Map tag = new HashMap<>(); @@ -973,7 +972,7 @@ public void setTime(OffsetDateTime time) { } - public WebhookVisit url(URI url) { + public WebhookVisit url(String url) { this.url = url; return this; } @@ -987,14 +986,14 @@ public WebhookVisit url(URI url) { @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public URI getUrl() { + public String getUrl() { return url; } @JsonProperty(JSON_PROPERTY_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUrl(URI url) { + public void setUrl(String url) { this.url = url; } diff --git a/src/test/resources/mocks/get_event_200.json b/src/test/resources/mocks/get_event_200.json index 23fe4d4..0633376 100644 --- a/src/test/resources/mocks/get_event_200.json +++ b/src/test/resources/mocks/get_event_200.json @@ -9,7 +9,7 @@ "tag": {}, "time": "2019-05-21T16:40:13Z", "timestamp": 1582299576512, - "url": "https://www.example.com/login", + "url": "https://www.example.com/login?hope{this{works[!", "ip": "61.127.217.15", "ipLocation": { "accuracyRadius": 10, @@ -63,7 +63,7 @@ "bot": { "result": "notDetected" }, - "url": "https://www.example.com/login", + "url": "https://www.example.com/login?hope{this{works}[!", "ip": "61.127.217.15", "time": "2019-05-21T16:40:13Z", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36",