Most files in the project are autogenerated by swagger-codegen.
- template - folder contains redefined templates of
swagger-codegen
. Original templates you can find in swagger-codegen repo. - docs - generated documentation for models and API Client.
- src/FingerprintPro.ServerSdk - API Client code is generated automatically.
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
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
Tests are located in tests.
To run tests you can use IDE instruments or just run:
dotnet test
To make requests using the local version of the SDK you can use the debugger inside VS Code.
- 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
}
}
]
}
- 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
). - Run
dotnet build
in the terminal. - 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.
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.