This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Swaggatherer (Swagger + Gatherer)
This is a new CLI tool that will generate a routing benchmark from an input directory or file. See following commits for examples
- Loading branch information
Showing
8 changed files
with
423 additions
and
14 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
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,14 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Swaggatherer | ||
{ | ||
internal static class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var application = new SwaggathererApplication(); | ||
application.Execute(args); | ||
} | ||
} | ||
} |
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,23 @@ | ||
# Swaggatherer (Swagger + Gatherer) | ||
|
||
This is a cli tool that can generate a routing benchmark using a Swagger 2.0 spec as an input. | ||
|
||
## Usage | ||
|
||
Generate a benchmark from a swagger file: | ||
``` | ||
dotnet run -- -i swagger.json -o MyGeneratedBenchark.generated.cs | ||
``` | ||
|
||
Generate a benchmark from a directory of swagger files: | ||
``` | ||
dotnet run -- -d /some/directory -o MyGeneratedBenchark.generated.cs | ||
``` | ||
|
||
The directory mode will recursively search for `.json` files. | ||
|
||
## Resources | ||
|
||
A big repository of swagger docs: https://github.com/APIs-guru/openapi-directory | ||
Swagger editor + yaml <-> json conversion tool: https://editor2.swagger.io | ||
Azure's official swagger docs: https://github.com/Azure/azure-rest-api-specs |
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 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.AspNetCore.Routing.Template; | ||
|
||
namespace Swaggatherer | ||
{ | ||
internal class RouteEntry | ||
{ | ||
public RouteTemplate Template { get; set; } | ||
public string Method { get; set; } | ||
public decimal Precedence { get; set; } | ||
public string RequestUrl { get; set; } | ||
} | ||
} |
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Routing\Microsoft.AspNetCore.Routing.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.