MMonrad.OpenApi.NodaTime 0.0.23

dotnet add package MMonrad.OpenApi.NodaTime --version 0.0.23
                    
NuGet\Install-Package MMonrad.OpenApi.NodaTime -Version 0.0.23
                    
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.NodaTime" Version="0.0.23" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MMonrad.OpenApi.NodaTime" Version="0.0.23" />
                    
Directory.Packages.props
<PackageReference Include="MMonrad.OpenApi.NodaTime" />
                    
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.NodaTime --version 0.0.23
                    
#r "nuget: MMonrad.OpenApi.NodaTime, 0.0.23"
                    
#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.NodaTime@0.0.23
                    
#: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.NodaTime&version=0.0.23
                    
Install as a Cake Addin
#tool nuget:?package=MMonrad.OpenApi.NodaTime&version=0.0.23
                    
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 string An elapsed time measured in nanoseconds, mapped to 25:01:01.001. 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" }

Contributing

If you want to contribute to the project and make it better, your help is very welcome.

How to make a clean pull request

  • Create a personal fork of the project on Github.
  • Create a new branch to work on! Branch from main.
  • Implement/fix your feature, comment your code.
  • Follow the code style of the project, including indentation.
  • Add or change the documentation as needed.
  • From your fork open a pull request in the correct branch. Target the project's main branch.
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

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
0.0.23 241 9/3/2025
0.0.17 757 1/3/2025
0.0.16 131 12/22/2024
0.0.11 106 12/21/2024
0.0.9 108 12/21/2024