Soenneker.Attributes.PublicOpenApiObject 4.0.52

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Attributes.PublicOpenApiObject

A marker attribute for contract classes whose schemas are eligible for a public OpenAPI document.

Installation

dotnet add package Soenneker.Attributes.PublicOpenApiObject

Usage

using Soenneker.Attributes.PublicOpenApiObject;

[PublicOpenApiObject]
public sealed class PublicCustomer
{
    public required string Id { get; init; }
    public required string DisplayName { get; init; }
}

An OpenAPI schema or document filter can select marked types:

using System.Reflection;

bool include = typeof(PublicCustomer)
    .IsDefined(typeof(PublicOpenApiObjectAttribute), inherit: true);

Important behavior

  • The attribute targets classes. It cannot be applied directly to structs, enums, interfaces, or individual properties.
  • Derived classes observe the marker through normal inherited attribute lookup.
  • The package does not add, remove, or modify OpenAPI schemas on its own; a generator integration must read the marker.
  • Marking a type does not prove that every property is safe to publish. Review the complete serialized schema before including it in a public document.
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 (25)

Showing the top 5 NuGet packages that depend on Soenneker.Attributes.PublicOpenApiObject:

Package Downloads
Soenneker.Enums.UnitOfTime

An enumerator for describing an interval of time

Soenneker.Dtos.ProblemDetails

A replication of .NET's ProblemDetails (https://tools.ietf.org/html/rfc7807) that doesn't rely on Microsoft.AspNetCore.Mvc.

Soenneker.Enums.DayOfWeek

An enumerator for describing the day of the week (Mon, Tues, ..)

Soenneker.Dtos.IdNamePair

A minimal Record type with an Id (string), Name (string), and maximum JSON compatibility

Soenneker.Dtos.IdPartitionPair

A minimal Record type with an Id (string), PartitionKey (string), and maximum JSON compatibility

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.52 10,727 8/29/2026
4.0.50 223 8/29/2026
4.0.49 25,297 8/18/2026
4.0.48 28,969 7/27/2026
4.0.47 25,174 7/16/2026
4.0.46 35,546 6/18/2026
4.0.45 32,322 6/5/2026
4.0.44 40,715 4/22/2026
4.0.42 37,744 3/12/2026
4.0.41 638 3/12/2026
4.0.40 670 3/12/2026
4.0.39 5,988 3/12/2026
4.0.38 18,384 3/10/2026
4.0.37 9,202 3/9/2026
4.0.36 804 3/9/2026
4.0.35 1,288 3/9/2026
4.0.34 24,507 3/4/2026
4.0.33 105,275 1/2/2026
4.0.32 37,370 11/20/2025
4.0.31 25,092 11/6/2025
Loading failed

Restore CodeQL badge