-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release library
- Loading branch information
Showing
53 changed files
with
2,176 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"minicover": { | ||
"version": "3.4.1", | ||
"commands": [ | ||
"minicover" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.2.32630.192 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F8025343-BDFB-429E-A143-E73A09C51B50}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{722A9F3A-65E6-4D71-95EA-4D242B78E107}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swagger.Documentation", "src\Swagger.Documentation\Swagger.Documentation.csproj", "{6FC96219-71A2-4755-8671-E9D6C8E1CDD7}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swagger.Documentation.Test", "test\Swagger.Documentation.Test\Swagger.Documentation.Test.csproj", "{1DD26821-68C9-4B01-9E57-CCEB54B2397F}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "items", "items", "{DE00FEDE-BC74-4876-8F2E-EC7D26EBE602}" | ||
ProjectSection(SolutionItems) = preProject | ||
.gitignore = .gitignore | ||
.travis.yml = .travis.yml | ||
example.png = example.png | ||
LICENSE = LICENSE | ||
README.md = README.md | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{FF4F3CAA-5EF4-42DD-AC2C-8732D74DBD0F}" | ||
ProjectSection(SolutionItems) = preProject | ||
.config\dotnet-tools.json = .config\dotnet-tools.json | ||
EndProjectSection | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{12156B4A-40FB-4D1D-AD75-E507CB2AE558}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleSwaggerDocumentation", "samples\SampleSwaggerDocumentation\SampleSwaggerDocumentation.csproj", "{030EF24D-1150-451C-B0F3-816BC8CA2AB3}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleSwaggerDocumentationVersion", "samples\SampleSwaggerDocumentationVersion\SampleSwaggerDocumentationVersion.csproj", "{AAD9BB32-C674-4741-977D-CBC3B35651CC}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swagger.Documentation.VersionTest", "test\Swagger.Documentation.VersionTest\Swagger.Documentation.VersionTest.csproj", "{C292E5E4-E56A-4366-BDCF-C9D8C1B9F8C4}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swagger.Documentation.ExceptionTest", "test\Swagger.Documentation.ExceptionTest\Swagger.Documentation.ExceptionTest.csproj", "{7008C0AB-95DB-43FC-90B6-8D766E4B007D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{6FC96219-71A2-4755-8671-E9D6C8E1CDD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6FC96219-71A2-4755-8671-E9D6C8E1CDD7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6FC96219-71A2-4755-8671-E9D6C8E1CDD7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6FC96219-71A2-4755-8671-E9D6C8E1CDD7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{1DD26821-68C9-4B01-9E57-CCEB54B2397F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1DD26821-68C9-4B01-9E57-CCEB54B2397F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1DD26821-68C9-4B01-9E57-CCEB54B2397F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1DD26821-68C9-4B01-9E57-CCEB54B2397F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{030EF24D-1150-451C-B0F3-816BC8CA2AB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{030EF24D-1150-451C-B0F3-816BC8CA2AB3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{030EF24D-1150-451C-B0F3-816BC8CA2AB3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{030EF24D-1150-451C-B0F3-816BC8CA2AB3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{AAD9BB32-C674-4741-977D-CBC3B35651CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{AAD9BB32-C674-4741-977D-CBC3B35651CC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{AAD9BB32-C674-4741-977D-CBC3B35651CC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{AAD9BB32-C674-4741-977D-CBC3B35651CC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{C292E5E4-E56A-4366-BDCF-C9D8C1B9F8C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C292E5E4-E56A-4366-BDCF-C9D8C1B9F8C4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C292E5E4-E56A-4366-BDCF-C9D8C1B9F8C4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C292E5E4-E56A-4366-BDCF-C9D8C1B9F8C4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{7008C0AB-95DB-43FC-90B6-8D766E4B007D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7008C0AB-95DB-43FC-90B6-8D766E4B007D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7008C0AB-95DB-43FC-90B6-8D766E4B007D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7008C0AB-95DB-43FC-90B6-8D766E4B007D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{6FC96219-71A2-4755-8671-E9D6C8E1CDD7} = {F8025343-BDFB-429E-A143-E73A09C51B50} | ||
{1DD26821-68C9-4B01-9E57-CCEB54B2397F} = {722A9F3A-65E6-4D71-95EA-4D242B78E107} | ||
{FF4F3CAA-5EF4-42DD-AC2C-8732D74DBD0F} = {DE00FEDE-BC74-4876-8F2E-EC7D26EBE602} | ||
{030EF24D-1150-451C-B0F3-816BC8CA2AB3} = {12156B4A-40FB-4D1D-AD75-E507CB2AE558} | ||
{AAD9BB32-C674-4741-977D-CBC3B35651CC} = {12156B4A-40FB-4D1D-AD75-E507CB2AE558} | ||
{C292E5E4-E56A-4366-BDCF-C9D8C1B9F8C4} = {722A9F3A-65E6-4D71-95EA-4D242B78E107} | ||
{7008C0AB-95DB-43FC-90B6-8D766E4B007D} = {722A9F3A-65E6-4D71-95EA-4D242B78E107} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {267B9DBE-00E4-4AED-8E9B-9A8CDFC062AB} | ||
EndGlobalSection | ||
EndGlobal |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
samples/SampleSwaggerDocumentation/ApiDocs/WeatherForecast/Diagrams/main.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions
8
samples/SampleSwaggerDocumentation/ApiDocs/WeatherForecast/Diagrams/main.wsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@startuml | ||
autonumber "<b>[00]" | ||
Participant "this service" as S | ||
Participant "integration-service" as IS #f0f0f0 | ||
|
||
S [#red]-> IS | ||
S <--[#red] IS | ||
@enduml |
12 changes: 12 additions & 0 deletions
12
samples/SampleSwaggerDocumentation/ApiDocs/WeatherForecast/Get.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<details> | ||
<summary>Details</summary> | ||
|
||
## Note | ||
|
||
## Schema | ||
|
||
![Sequence diagram](Diagrams/main.svg) | ||
|
||
## Algorithm | ||
|
||
</details> |
38 changes: 38 additions & 0 deletions
38
samples/SampleSwaggerDocumentation/Controllers/WeatherForecastController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Logging; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace SampleSwaggerDocumentation.Controllers | ||
{ | ||
[ApiController] | ||
[Route("[controller]")] | ||
public class WeatherForecastController : ControllerBase | ||
{ | ||
private static readonly string[] Summaries = new[] | ||
{ | ||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | ||
}; | ||
|
||
private readonly ILogger<WeatherForecastController> _logger; | ||
|
||
public WeatherForecastController(ILogger<WeatherForecastController> logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
[HttpGet] | ||
public IEnumerable<WeatherForecast> Get() | ||
{ | ||
var rng = new Random(); | ||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = DateTime.Now.AddDays(index), | ||
TemperatureC = rng.Next(-20, 55), | ||
Summary = Summaries[rng.Next(Summaries.Length)] | ||
}) | ||
.ToArray(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
namespace SampleSwaggerDocumentation | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateHostBuilder(args).Build().Run(); | ||
} | ||
|
||
public static IHostBuilder CreateHostBuilder(string[] args) => | ||
Host.CreateDefaultBuilder(args) | ||
.ConfigureWebHostDefaults(webBuilder => | ||
{ | ||
webBuilder.UseStartup<Startup>(); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
samples/SampleSwaggerDocumentation/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:64156", | ||
"sslPort": 0 | ||
} | ||
}, | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"SampleSwaggerDocumentation": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": "true", | ||
"launchBrowser": true, | ||
"launchUrl": "swagger", | ||
"applicationUrl": "http://localhost:5000", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
samples/SampleSwaggerDocumentation/SampleSwaggerDocumentation.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Swagger.Documentation\Swagger.Documentation.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="ApiDocs\**"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.OpenApi.Models; | ||
using Swagger.Documentation; | ||
using System; | ||
|
||
namespace SampleSwaggerDocumentation | ||
{ | ||
public class Startup | ||
{ | ||
public Startup(IConfiguration configuration) | ||
{ | ||
Configuration = configuration; | ||
} | ||
|
||
public IConfiguration Configuration { get; } | ||
|
||
// This method gets called by the runtime. Use this method to add services to the container. | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
|
||
services.AddControllers(); | ||
services.AddSwaggerGen(options => | ||
{ | ||
options.SwaggerDoc("v1", new OpenApiInfo | ||
{ | ||
Version = "v1", | ||
Title = "ToDo API", | ||
Description = "An ASP.NET Core Web API for managing ToDo items", | ||
TermsOfService = new Uri("https://example.com/terms"), | ||
Contact = new OpenApiContact | ||
{ | ||
Name = "Example Contact", | ||
Url = new Uri("https://example.com/contact") | ||
}, | ||
License = new OpenApiLicense | ||
{ | ||
Name = "Example License", | ||
Url = new Uri("https://example.com/license") | ||
} | ||
}); | ||
options.OperationFilter<WriteMarkdownToDescriptionOperationFilter>(); | ||
}); | ||
} | ||
|
||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | ||
{ | ||
if (env.IsDevelopment()) | ||
{ | ||
app.UseDeveloperExceptionPage(); | ||
} | ||
|
||
app.UseSwagger(); | ||
app.UseSwaggerUISupportMarkdown(); | ||
|
||
app.UseRouting(); | ||
|
||
app.UseAuthorization(); | ||
|
||
app.UseEndpoints(endpoints => | ||
{ | ||
endpoints.MapControllers(); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace SampleSwaggerDocumentation | ||
{ | ||
public class WeatherForecast | ||
{ | ||
public DateTime Date { get; set; } | ||
|
||
public int TemperatureC { get; set; } | ||
|
||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
|
||
public string Summary { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
samples/SampleSwaggerDocumentation/appsettings.Development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
Oops, something went wrong.