Jtechs.OpenApi.AspNetCore 0.2.5

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

OpenApi.AspNetCore

This package helps openapi swagger.json to have detailed enum information.

Jtechs.OpenApi.AspNetCore

https://www.nuget.org/packages/Jtechs.OpenApi.AspNetCore

Base common file for the openapi helper. Add enum to have title and description to the swagger.json

Jtechs.OpenApi.AspNetCore.Swashbuclke

https://www.nuget.org/packages/Jtechs.OpenApi.AspNetCore.Swashbuckle

Swashbuclke extension to add enum title and description in the $type section.

if you define following enum in C#

[DisplayNameForEnum("MLB League"), Description("MLB League names")]
public enum League
{
    [DisplayNameForEnum("American League"), Description("The American League of Professional Baseball Clubs, known simply as the American League (AL), is one of two leagues that make up Major League Baseball (MLB) in the United States and Canada.")]
    American = 1,

    [DisplayNameForEnum("National League"), Description("The National League of Professional Baseball Clubs, known simply as the National League (NL), is the older of two leagues constituting Major League Baseball (MLB) in the United States and Canada.")]
    National = 2,
}

You can use this nuget package and write following in your Program.cs

builder.Services.AddSwaggerGen(options =>
{
    options.AddJtechsOpenApiFilters();
});

this will add more detail information on swagger.json


"components": {
    "schemas": {
      "League": {
        "title": "MLB League",
        "enum": [
          1,
          2
        ],
        "type": "integer",
        "description": "MLB League names",
        "format": "int32",
        "x-enum-values": [
          1,
          2
        ],
        "x-enum-varnames": [
          "American",
          "National"
        ],
        "x-enum-titles": [
          "American League",
          "National League"
        ],
        "x-enum-descriptions": [
          "The American League of Professional Baseball Clubs, known simply as the American League (AL), is one of two leagues that make up Major League Baseball (MLB) in the United States and Canada.",
          "The National League of Professional Baseball Clubs, known simply as the National League (NL), is the older of two leagues constituting Major League Baseball (MLB) in the United States and Canada."
        ]
      },
    }
}

License

Apache License Version 2.0

See LICENSE

Support

If you would like to support our Open Source Activity, you can do it from our Sponsor Page

Copyright (c) 2024- J-Tech Japan

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 Jtechs.OpenApi.AspNetCore:

Package Downloads
Jtechs.OpenApi.AspNetCore.Swashbuckle

J-Tech Japan OpenApi Extension for Swashbuclke

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.5 1,979 11/15/2024
0.2.4 103 11/15/2024
0.2.3 304 11/14/2024
0.2.2 3,294 2/12/2024
0.2.1 185 1/22/2024
0.2.0 142 1/22/2024
0.1.3 306 1/17/2024
0.1.2 157 1/16/2024
0.1.1 149 1/16/2024
0.1.0 146 1/16/2024