Skip to content

Latest commit

 

History

History
83 lines (61 loc) · 3.44 KB

contributing.md

File metadata and controls

83 lines (61 loc) · 3.44 KB

Contributing to Fingerprint Pro Server API SDK

Structure

Most files in the project are autogenerated by swagger-codegen.

Code generation

You need swagger-codegen to run code generation. There are many ways described in the readme. In the project we use local jar file swagger-codegen-cli.jar.

You can just run ./generate.sh script and it will do all the work.

To download fresh OpenAPI schema run ./sync.sh

Configuration

Project configuration is described in config.json file. To read about available parameters run the command below:

java -jar ./bin/swagger-codegen-cli.jar config-help -l csharp

Running tests

Tests are located in tests.

To run tests you can use IDE instruments or just run:

dotnet test

Testing the local source code of the SDK

To make requests using the local version of the SDK you can use the debugger inside VS Code.

  1. Add this launch.json file to the project's .vscode folder:
{
  "version": "0.2.0",
  "configurations": [
    {
      // Use IntelliSense to find out which attributes exist for C# debugging
      // Use hover for the description of the existing attributes
      // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md
      "name": ".NET Core Launch (console)",
      "type": "coreclr",
      "request": "launch",
      "preLaunchTask": "build",
      // If you have changed target frameworks, make sure to update the program path.
      "program": "${workspaceFolder}/src/FingerprintPro.ServerSdk.ExamplesNet7/bin/Debug/net7.0/FingerprintPro.ServerSdk.ExamplesNet7.dll",
      "args": [],
      "cwd": "${workspaceFolder}/src/FingerprintPro.ServerSdk.ExamplesNet7",
      // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
      "console": "internalConsole",
      "stopAtEntry": false,
      "env": {
        "VISITOR_ID": "<VISITOR_ID>",
        "REQUEST_ID": "<REQUEST_ID>",
        "API_KEY": "<API_KEY>",
        "REGION": "<REGION>" // e.g. "eu" or "ap", "us" is the default
      }
    }
  ]
}
  1. Replace environment variable placeholders with your API Key, Visitor ID, Request ID. Define REGION if you want to use a region other than the default one (us).
  2. Run dotnet build in the terminal.
  3. Run the debugger (F5).

The debugger will run the code inside src/FingerprintPro.ServerSdk.ExamplesNet7/Program.cs using the local source code of the SDK. If you change Program.cs you will need run dotnet build again for the changes to take effect.

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. After the release is created, the package is published to nuget by publish.yml workflow.