Skip to content

Latest commit

 

History

History
55 lines (33 loc) · 2.76 KB

File metadata and controls

55 lines (33 loc) · 2.76 KB

Contributing to Fingerprint Server API SDK

Structure

Most files in the project are autogenerated by openapi-generator for Java.

  • template - templates used by openapi-generator.
  • docs - generated documentation for models and API Client.
  • sdk - automatically generated API client code.

Commit messages

This project follows the Conventional Commits standard. Each commit message should be structured as:

<type>: <description>

[optional body]

Code generation and building the SDK

Use the Gradle build to invoke openapi-generator and generate the code and documentation:

./gradlew build

To download the latest OpenAPI schema from fingerprintjs/fingerprint-pro-server-api-openapi, run ./scripts/sync.sh

Updating the codegen engine and templates

The generator version is pinned as the openapi entry in gradle/libs.versions.toml. To update it:

  1. Bump the openapi version in that file.
  2. Compare each file in template against the matching upstream java or jersey3 generator template at the new version, and merge in any upstream changes the same way you would resolve a merge conflict.
  3. Update the engine and the templates in the same change. Using the new engine with old templates, or the other way around, can break code generation without a clear error.

Testing the local source code of the SDK

Use the ./src/examples/java/com/fingerprint/example/FunctionalTests.java file to make API requests using the local version of the SDK.

  1. Make sure you have Java Development Kit 11 or later installed.
  2. Create an .env file in the root of this repo, using .env.example as the starting point.
  3. Finally, run ./gradlew runFunctionalTests.

Configuration

The Gradle configuration defines the options for openapi-generator, within the openApiGenerate block in sdk.gradle.kts.

How to publish

We use changesets for handling release notes. If there are relevant changes, please add them to changeset via pnpm exec changeset. You need to run pnpm install before doing so.

When creating prereleases, the rc tag must be used. This ensures that version ranges in Maven/Gradle do not pick the prerelease as a new version. For more information, refer to the Version Order Specification Maven Documentation.