forked from teocomi/BCFier
-
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.
Update frontend models generation to use proper NSwag pipeline
- Loading branch information
1 parent
eef1e7a
commit 168b24c
Showing
31 changed files
with
1,196 additions
and
272 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
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
40 changes: 40 additions & 0 deletions
40
src/IPA.Bcfier.App/Configuration/BcfierSwaggerConfigurationExtensions.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,40 @@ | ||
using NSwag; | ||
|
||
namespace IPA.Bcfier.App.Configuration | ||
{ | ||
public static class BcfierSwaggerConfigurationExtensions | ||
{ | ||
public static IServiceCollection AddBcfierSwagger(this IServiceCollection services) | ||
{ | ||
services.AddOpenApiDocument(c => | ||
{ | ||
c.Description = "\"Access to the IPA.Bcfier API\" API Specification"; | ||
c.Version = FileVersionProvider.NuGetVersion; | ||
c.Title = $"\"Access to the IPA.Bcfier API\" API {FileVersionProvider.NuGetVersion}"; | ||
}); | ||
|
||
return services; | ||
} | ||
|
||
public static IApplicationBuilder UseBcfierSwaggerUi(this IApplicationBuilder app) | ||
{ | ||
app.UseOpenApi(c => | ||
{ | ||
c.Path = "/swagger/swagger.json"; | ||
c.PostProcess = (doc, _) => | ||
{ | ||
// This makes sure that Azure warmup requests that are sent via Http instead of | ||
// Https don't set the document schema to http only | ||
doc.Schemes = new List<OpenApiSchema> { OpenApiSchema.Https }; | ||
}; | ||
}); | ||
app.UseSwaggerUi(settings => | ||
{ | ||
settings.DocumentPath = "/swagger/swagger.json"; | ||
settings.Path = "/swagger"; | ||
}); | ||
|
||
return app; | ||
} | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.