Test, build and code quality improvements#6
Conversation
- Update the `JSON` template to remove the package-private unused `getDiscriminatorPropertyName`.
- Update Gradle config to specify `-Xlint:all -Werror` to the Java compiler. - Fix warnings in Sealed.java related to serialVersionUID - Fix warnings and general issues in FingerprintApiTest.java
- Update the gradle config for the examples to only allow use of Java 11 features. This was previously already done for the sdk module.
- Update FunctionalTests to include an example/test for evaluating an event against a ruleset. - Update sync script to pull down ruleset examples - Update FingerprintApiTest to use the same `ObjectMapper` that the SDK uses to deserialize data to avoid discrepancies in configuration. - Add ruleset test cases to FingerprintApiTest - Fix issue found in template where the `type` value was not being set on the deserialized EventRuleAction.
- Apply doc updates from the schema - Update handling for `tags` properties in the `Event` and `EventUpdate` to assume the `tags` default to an empty map.
- Disable the `this-escape` warning for the `ApiClient` constructor. Fixing this warning would require significant changes to the `ApiClient` class and could precipitate unnecessary breaking changes to SDK users that are leveraging the client customization hooks to setup their own HTTP client in the Jersey configuration.
- Rework the Gradle build to allow the Java compiler and launcher version to be specified with a command line property. This allows Gradle 8 to use Java 25 without using it for execution (which it doesn't support). - Add logging to the Gradle build to log what Java version is used to confirm the correct version of Java is used for compiling and running tests. - Add `--stacktrace` flag to gradlew builds to improve logs when builds fail.
- Configure openapi-generator with `enumUnknownDefaultCase` option. This adds an unused enum value to the template data/hash that can be used to substitute a placeholder value for all enums. - Update templates to add a `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` value that is used when deserializing an enum value that is unknown to the SDK. This allows events with new enum values to be deserialized without failing deserialization. - Add unit tests to confirm enum value deserialization is forward compatible
| |------------ | ------------- | ------------- | -------------| | ||
| |**linkedId** | **String** | Linked Id value to assign to the existing event | [optional] | | ||
| |**tags** | **Object** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] | | ||
| |**tags** | **Map<String, Object>** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] | |
There was a problem hiding this comment.
Another place with html symbols instead of utf
There was a problem hiding this comment.
I think < and > still need to use HTML escapes because some HTML tags are allowed in Markdown. I don't think this particular case has issues if it is not escaped (i.e. Map<String, Object>), but if it were instead List<String>, the <String> isn't rendered because the parser thinks that an HTML tag.
So, rather than try to identify the cases where there is a single generic type parameter in a data type, I opted to leave the data types escaped
There was a problem hiding this comment.
Pull request overview
This PR synchronizes the Java SDK/templates with the latest API schema, expands CI test coverage to additional Java versions (incl. Java 25), and tightens build quality gates (toolchains + warnings-as-errors). It also adds/updates mocks and tests around ruleset evaluation and fixes package/import paths in generated documentation examples.
Changes:
- Update OpenAPI schema + regenerate models/docs (notably
tagstyping and documentation links) and fix example imports. - Add ruleset evaluation mocks/tests and expand search/getEvent test cases.
- Configure Gradle toolchains and CI matrices (Java 11/17/21/25) and enforce compiler warnings as errors.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| template/libraries/jersey3/oneof_model.mustache | Make discriminator property visible during Jackson polymorphic deserialization. |
| template/libraries/jersey3/api_doc.mustache | Fix documentation snippet imports/package paths. |
| template/libraries/jersey3/apiException.mustache | Add jersey3 ApiException template (new). |
| template/libraries/jersey3/JSON.mustache | Add JSON/Jackson configuration template (new). |
| template/libraries/jersey3/ApiClient.mustache | Add full jersey3 ApiClient template (new). |
| sdk/src/test/resources/mocks/events/get_event_ruleset_200.json | Add mock event response including rule_action. |
| sdk/src/test/resources/mocks/errors/400_ruleset_not_found.json | Add mock error payload for ruleset-not-found. |
| sdk/src/test/java/com/fingerprint/v4/api/FingerprintApiTest.java | Refactor tests to use shared SDK JSON mapper + add ruleset tests and more search params coverage. |
| sdk/src/main/java/com/fingerprint/v4/sdk/JSON.java | Remove unused discriminator helper method. |
| sdk/src/main/java/com/fingerprint/v4/sdk/ApiException.java | Improve serialization compatibility (serialVersionUID + transient headers). |
| sdk/src/main/java/com/fingerprint/v4/sdk/ApiClient.java | Suppress this-escape warning for constructor. |
| sdk/src/main/java/com/fingerprint/v4/model/SearchEventsBot.java | Fix docstring to reference bot field (not botd.bot). |
| sdk/src/main/java/com/fingerprint/v4/model/EventUpdate.java | Change tags from Object to Map<String,Object> and adjust JSON annotations/helpers. |
| sdk/src/main/java/com/fingerprint/v4/model/EventRuleAction.java | Make discriminator visible for rule action polymorphism. |
| sdk/src/main/java/com/fingerprint/v4/model/Event.java | Change tags from Object to Map<String,Object> and update doc links. |
| sdk/src/main/java/com/fingerprint/v4/api/FingerprintApi.java | Update documentation links and parameter docs to new docs domain/anchors. |
| sdk/src/main/java/com/fingerprint/v4/Sealed.java | Add serialVersionUIDs to exceptions. |
| sdk/sdk.gradle.kts | Switch to Gradle toolchains with configurable Java version property. |
| scripts/sync.sh | Ensure new mocks are synced from examples list. |
| res/fingerprint-server-api.yaml | Update schema docs links and set additionalProperties: true for tags. |
| examples/src/main/java/com/fingerprint/example/FunctionalTests.java | Add ruleset evaluation example code + explicit imports. |
| examples/examples.gradle.kts | Configure toolchain and JavaExec launcher via toolchains. |
| docs/SearchEventsBot.md | Align docs text with bot field naming. |
| docs/FingerprintApi.md | Fix imports and update docs links/anchors in examples. |
| docs/EventUpdate.md | Update tags type to Map<String,Object>. |
| docs/Event.md | Update tags type and doc links. |
| build.gradle.kts | Enforce Java 11 --release, enable all lint warnings, and fail build on warnings; print toolchain info. |
| .github/workflows/test.yml | Expand Java matrix and remove setup-java reliance. |
| .github/workflows/functional.yml | Expand Java matrix and pass toolchain version property to Gradle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…alues fix: make enum value deserialization forward compatible
🚀 Following releases will be created using changesets from this PR:java-sdk@8.0.0-rc.1Patch Changes
|
5cb6e12
into
docs/INTER-1819-public-updates
ubuntu-latest. Gradle will find these installations and be able to use them when configured to do soFingerprintApi.mdexamples