SIPS.Adapter 1.0.2

dotnet add package SIPS.Adapter --version 1.0.2
                    
NuGet\Install-Package SIPS.Adapter -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SIPS.Adapter" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SIPS.Adapter" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SIPS.Adapter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SIPS.Adapter --version 1.0.2
                    
#r "nuget: SIPS.Adapter, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SIPS.Adapter@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SIPS.Adapter&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SIPS.Adapter&version=1.0.2
                    
Install as a Cake Tool

SIPS Adapter

This package provides a JSON adapter for SIPS.

Overview

  • Implements essential JSON conversion for SIPS integration.
  • Follows NuGet best practices for package documentation.

JSON Mapping Details

The adapter translates JSON from the request body to the internal system JSON format using the following mappings:

  • "InternalField": Maps to the internal system field.
  • "UserField": Maps to the value provided by the user.
  • "Type": Specifies the type of the JSON payload.

Usage

To use the adapter, follow these steps:

  1. Install the package.
  2. Add the package to your IServiceCollection.
  3. Use the IJsonAdapter interface to convert the JSON.
services.AddJsonAdapter();

var jsonAdapter = serviceProvider.GetRequiredService<IJsonAdapter>();

// Provide the endpoint name that corresponds to your configured mapping
var internalJson = jsonAdapter.Transform(userJson, endpointName);

Configuring Endpoint Mappings

The adapter requires an endpointName to determine how to map incoming JSON. Provide a configured JsonAdapterOptions instance via DI (the library registers an empty default you can replace):

using SIPS.Adapter.Models;

services.AddSingleton(new JsonAdapterOptions
{
    Endpoints = new Dictionary<string, EndpointMapping>
    {
        ["createPayment"] = new EndpointMapping
        {
            FieldMappings = new List<FieldMapping>
            {
                new FieldMapping { InternalField = "amount", UserField = "data.amount", Type = MappingType.Int },
                new FieldMapping { InternalField = "reference", UserField = "data.ref", Type = MappingType.String },
                new FieldMapping { InternalField = "timestamp", UserField = "meta.createdAt", Type = MappingType.DateTime }
            }
        }
    }
});

// Later
var mapped = jsonAdapter.Transform(userJson, "createPayment");

Reverse Mapping From Object to External JSON

To map from a local object into an external (user) JSON shape, use the generic overload:

var userJsonOut = jsonAdapter.Transform(localObject, endpointName);
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SIPS.Adapter:

Package Downloads
SIPS.Core

SIPS CORE

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 808 11/16/2025
1.0.1 276 10/30/2025
1.0.0 501 2/10/2025