Yapidoo.Common.Api 1.0.0

dotnet add package Yapidoo.Common.Api --version 1.0.0
                    
NuGet\Install-Package Yapidoo.Common.Api -Version 1.0.0
                    
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="Yapidoo.Common.Api" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yapidoo.Common.Api" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Yapidoo.Common.Api" />
                    
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 Yapidoo.Common.Api --version 1.0.0
                    
#r "nuget: Yapidoo.Common.Api, 1.0.0"
                    
#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 Yapidoo.Common.Api@1.0.0
                    
#: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=Yapidoo.Common.Api&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Yapidoo.Common.Api&version=1.0.0
                    
Install as a Cake Tool

Yapidoo.Common.Api

NuGet License: MIT

Shared HTTP transport primitives for Yapidoo .NET 10 microservices.

Features

  • Shared response envelopes for single, list, and paged responses
  • Standard API error contract with nested details support
  • Common paging payload and filter request primitives
  • Consistent JSON contract shape for all service business endpoints

Installation

dotnet add package Yapidoo.Common.Api

Quick Start

1. Return a single item envelope

using Yapidoo.Common.Api.Models;

var response = new ServiceApiResponse<UserApiResponse>
{
    Data = new UserApiResponse
    {
        Id = Guid.NewGuid(),
        Email = "user@yapidoo.com"
    },
    TimeStamp = DateTime.UtcNow
};

2. Return a validation error envelope

using Yapidoo.Common.Api.Models;

var response = new ServiceApiResponse<object>
{
    Errors = new[]
    {
        new ApiError
        {
            Code = "VALIDATION_ERROR",
            Message = "Email is required.",
            Target = "email"
        }
    },
    TimeStamp = DateTime.UtcNow
};

3. Return a paged envelope

using Yapidoo.Common.Api.Models;

var response = new ServicePagedApiResponse<UserApiResponse>
{
    Data = new PagedResult<UserApiResponse>
    {
        Items = new[]
        {
            new UserApiResponse { Id = Guid.NewGuid(), Email = "a@yapidoo.com" }
        },
        Page = 1,
        PageSize = 20,
        TotalItems = 1,
        TotalPages = 1,
        HasNext = false
    },
    TimeStamp = DateTime.UtcNow
};

Core Contracts

  • ApiError
  • ServiceApiResponse<T>
  • ServiceListApiResponse<T>
  • ServicePagedApiResponse<T>
  • PagedResult<T>
  • PageFilterApiRequest
  • SortFilterApiRequest
  • SearchFilterApiRequest

Usage Rule

  • Use these primitives at API transport boundaries.
  • Keep service-specific business request and response DTOs in each service.
  • Keep protocol-specific Auth/OIDC payloads standards-compliant.

Rollout Guidance

  • Rollout, migration matrix, and manual release steps: ../Yapidoo.Common.Api.Rollout.md
  • Contract source-of-truth and migration policy: ../Yapidoo.Common.Api.DesignSpec.md

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 180 3/16/2026

Initial release with shared API envelope, error, paging, and filter contracts.