MMonrad.OpenApi.Extensions
0.0.16
See the version list below for details.
dotnet add package MMonrad.OpenApi.Extensions --version 0.0.16
NuGet\Install-Package MMonrad.OpenApi.Extensions -Version 0.0.16
<PackageReference Include="MMonrad.OpenApi.Extensions" Version="0.0.16" />
<PackageVersion Include="MMonrad.OpenApi.Extensions" Version="0.0.16" />
<PackageReference Include="MMonrad.OpenApi.Extensions" />
paket add MMonrad.OpenApi.Extensions --version 0.0.16
#r "nuget: MMonrad.OpenApi.Extensions, 0.0.16"
#:package MMonrad.OpenApi.Extensions@0.0.16
#addin nuget:?package=MMonrad.OpenApi.Extensions&version=0.0.16
#tool nuget:?package=MMonrad.OpenApi.Extensions&version=0.0.16
Open Api Extensions
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.ConfigureNodaTime();
opt.AddType<CommandRequestId, string>(new CommandRequestId(Guid.Empty));
});
Extensions
NodaTime
Allows to configure Asp.Net Core and OpenApi to use NodaTime types.
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 | Versions 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. |
-
net9.0
- Microsoft.AspNetCore.OpenApi (>= 9.0.0)
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.