ShipEngine / shipengine-dotnet

The official ShipEngine SDK for C# and the .NET Framework
https://www.shipengine.com/docs/
Apache License 2.0
11 stars 11 forks source link
address-normalization address-validation csharp dhl-api fedex-api package-tracking rest-api sdk shipment-tracking shipping-api shipping-cost shipping-label shipping-rates ups-api usps-api

ShipEngine

ShipEngine .NET SDK

The official ShipEngine SDK for .NET

Nuget (with prereleases) GitHub

Build Status Coverage Status

OS Compatibility

Nuget Page

Quick Start

Install ShipEngine .NET SDK via the .NET CLI.

dotnet add package ShipEngine

The only configuration requirement is an API key.

using ShipEngineSDK;

var shipengine = new ShipEngine("___YOUR_API_KEY_HERE__");

Methods

Contributing

Contributions, enhancements, and bug-fixes are welcome! Open an issue on GitHub and submit a pull request.

Building

To build the project locally on your computer:

  1. Clone this repo
    git clone https://github.com/ShipEngine/shipengine-dotnet.git

  2. Install .NET 5.x

  3. Install dependencies
    dotnet restore

  4. Build the code
    dotnet build

  5. Format the code
    dotnet format

  6. Run the tests
    dotnet test

    By default, the test project targets all supported frameworks, if your environment only supports a subset then you can specify in the CLI.

    dotnet test -f net5.0

Generating from OpenAPI

To regenerate the SDK from the OpenAPI spec, you will first need to get the latest version of the spec. It can be downloaded from the online documentation and should be saved to ./generation/swagger.json. Then run npm run generate from the command line. This will regenerate all the API calls and models, but not docs or tests.

The templates for autogeneration were extracted using the command:

npx @openapitools/openapi-generator-cli author template -g csharp -o generation/templates

Release

Create a fork for your changes.

Update the Changelog with any relevant new features or bug fixes and modify the packageVersion property in the .openapitools.json file to match the new version.

In the ShipEngine.csproj file, update to the desired version (using semantic versioning) and push to your fork.

Run dotnet format

Create a pull request.

Once a member of the ShipEngine team reviews your PR and it's merged to main, the build pipeline will handle all the necessary github tags and nuget packaging and publishing.