Skip to content

Commit

Permalink
fix: remove wrong documentation links (swagger-codegen bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfa committed Apr 25, 2023
1 parent 7dd69c4 commit ae5b376
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 12 deletions.
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,16 @@ description = "Run the Functional Tests"
classpath = sourceSets.main.runtimeClasspath
main = 'com.fingerprint.example.FunctionalTests'
}

task removeWrongDocumentationLinks {
doLast {
fileTree("./docs").visit { FileVisitDetails details ->
if (details.file.isFile()) {
def fileContents = details.file.text
fileContents = fileContents.replace("[**OffsetDateTime**](OffsetDateTime.md)", "OffsetDateTime")
fileContents = fileContents.replace("[**URI**](URI.md)", "URI")
details.file.text = fileContents
}
}
}
}
2 changes: 1 addition & 1 deletion docs/BotdResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Contains all the information from Bot Detection product
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**ip** | **String** | IP address of the requesting browser or bot. | |
|**time** | [**OffsetDateTime**](OffsetDateTime.md) | Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible | |
|**time** | OffsetDateTime | Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible | |
|**url** | **String** | Page URL from which identification request was sent. | |
|**bot** | [**BotdDetectionResult**](BotdDetectionResult.md) | | |

Expand Down
4 changes: 2 additions & 2 deletions docs/ProductsResponseIdentificationData.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | [**OffsetDateTime**](OffsetDateTime.md) | Time expressed according to ISO 8601 in UTC format. | |
|**url** | [**URI**](URI.md) | Page URL from which identification request was sent. | |
|**time** | OffsetDateTime | Time expressed according to ISO 8601 in UTC format. | |
|**url** | URI | Page URL from which identification request was sent. | |
|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | [optional] |
|**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] |
|**confidence** | [**Confidence**](Confidence.md) | | |
Expand Down
4 changes: 2 additions & 2 deletions docs/ResponseVisits.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | [**OffsetDateTime**](OffsetDateTime.md) | Time expressed according to ISO 8601 in UTC format. | |
|**url** | [**URI**](URI.md) | Page URL from which identification request was sent. | |
|**time** | OffsetDateTime | Time expressed according to ISO 8601 in UTC format. | |
|**url** | URI | Page URL from which 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) | | |
Expand Down
4 changes: 2 additions & 2 deletions docs/SeenAt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**global** | [**OffsetDateTime**](OffsetDateTime.md) | | |
|**subscription** | [**OffsetDateTime**](OffsetDateTime.md) | | |
|**global** | OffsetDateTime | | |
|**subscription** | OffsetDateTime | | |



4 changes: 2 additions & 2 deletions docs/Visit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | [**OffsetDateTime**](OffsetDateTime.md) | Time expressed according to ISO 8601 in UTC format. | |
|**url** | [**URI**](URI.md) | Page URL from which identification request was sent. | |
|**time** | OffsetDateTime | Time expressed according to ISO 8601 in UTC format. | |
|**url** | URI | Page URL from which identification request was sent. | |
|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | [optional] |
|**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] |
|**confidence** | [**Confidence**](Confidence.md) | | |
Expand Down
4 changes: 2 additions & 2 deletions docs/WebhookVisit.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | [**OffsetDateTime**](OffsetDateTime.md) | Time expressed according to ISO 8601 in UTC format. | |
|**url** | [**URI**](URI.md) | Page URL from which identification request was sent. | |
|**time** | OffsetDateTime | Time expressed according to ISO 8601 in UTC format. | |
|**url** | URI | Page URL from which identification request was sent. | |
|**tag** | **Map<String, Object>** | A customer-provided value or an object that was sent with identification request. | [optional] |
|**linkedId** | **String** | A customer-provided id that was sent with identification request. | [optional] |
|**confidence** | [**Confidence**](Confidence.md) | | |
Expand Down
4 changes: 3 additions & 1 deletion scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ sed -i "s/artifactVersion: .*/artifactVersion: $VERSION/g" config.yaml

rm -rf pom.xml README.md build.gradle settings.gradle gradle.properties

java -jar ./bin/generator.jar generate -c config.yaml -g java --library jersey2 -i res/fingerprint-server-api.yaml --skip-validate-spec -o . -t template
java -jar ./bin/generator.jar generate -c config.yaml -g java --library jersey2 -i res/fingerprint-server-api.yaml --skip-validate-spec -o . -t template

./gradlew removeWrongDocumentationLinks
13 changes: 13 additions & 0 deletions template/libraries/jersey2/build.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,16 @@ description = "Run the Functional Tests"
classpath = sourceSets.main.runtimeClasspath
main = 'com.fingerprint.example.FunctionalTests'
}

task removeWrongDocumentationLinks {
doLast {
fileTree("./docs").visit { FileVisitDetails details ->
if (details.file.isFile()) {
def fileContents = details.file.text
fileContents = fileContents.replace("[**OffsetDateTime**](OffsetDateTime.md)", "OffsetDateTime")
fileContents = fileContents.replace("[**URI**](URI.md)", "URI")
details.file.text = fileContents
}
}
}
}

0 comments on commit ae5b376

Please sign in to comment.