MMonrad.OpenApi.Extensions 0.0.17

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

Open Api Extensions

Latest Release Latest Pre-Release Downloads License

Table of Contents

Elevator Pitch

Simplify your OpenAPI integration with our .NET 9 NuGet packages! OpenApi.Extensions delivers essential, reusable extensions to streamline and enhance your OpenAPI documentation. OpenApi.NodaTime builds on this foundation, adding seamless support for NodaTime, ensuring accurate and user-friendly representations of time-related data in your APIs. Perfect for developers seeking both flexibility and precision in their API solutions.

Example


var collection = new ServiceCollection();
using var services = collection.BuildServiceProvider();
services.AddOpenApi(opt =>
                    {
                        opt.OpenApiVersion = OpenApiSpecVersion.OpenApi3_0;
                        opt.AddDescription("This project contains samples on the extensions library OpenApi.Extensions.");
                        opt.ConfigureNodaTime();
                        opt.AddType<CommandRequestId, string>(new CommandRequestId(Guid.Empty));
                    });

Extensions

NodaTime

Allows to configure Asp.Net Core and OpenApi to use NodaTime types.

Latest Release Latest Pre-Release Downloads License

Installation

dotnet add package MMonrad.OpenApi.NodaTime

Type mappings

NodaTime Type OpenAPI Type OpenAPI Format Description Example
Instant string date-time Represents an instant in time (UTC) without time zone information. 2023-12-21T15:30:00Z
LocalDateTime string date-time A date and time without a time zone. 2023-12-21T15:30:00
LocalDate string date A date without a time component or time zone. 2023-12-21
LocalTime string time A time without a date or time zone. 15:30:00
OffsetDateTime string date-time A date and time with an offset from UTC, but without a specific time zone. 2023-12-21T15:30:00+01:00
OffsetTime string time A time with an offset from UTC, but without a specific date. 15:30:00+01:00
ZonedDateTime string date-time A date and time with a time zone. Often used for scheduling and calendaring. 2023-12-21T15:30:00+01:00[Europe/London]
Period string duration An ISO 8601 duration representing an elapsed time. P1Y2M10DT2H30M
Duration string duration An elapsed time measured in nanoseconds, mapped to ISO 8601 duration. PT2H30M
Interval object - Represents a time interval between two Instant values, expressed with start and end. { "start": "2023-12-21T10:00:00Z", "end": "2023-12-21T15:30:00Z" }
DateInterval object - A date interval between two LocalDate values, expressed with start and end. { "start": "2023-12-20", "end": "2023-12-25" }
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 MMonrad.OpenApi.Extensions:

Package Downloads
MMonrad.OpenApi.NodaTime

Extensions for OpenApi

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.17 323 1/3/2025
0.0.16 131 12/22/2024
0.0.11 116 12/21/2024
0.0.9 114 12/21/2024