https://github.com/lfzm/swashbuckle.orleans.swaggergen
Orleans based on Swashbuckle survival Swagger document component
https://github.com/lfzm/swashbuckle.orleans.swaggergen
orleans swagger swashbuckle
Last synced: 3 months ago
JSON representation
Orleans based on Swashbuckle survival Swagger document component
- Host: GitHub
- URL: https://github.com/lfzm/swashbuckle.orleans.swaggergen
- Owner: lfzm
- License: apache-2.0
- Created: 2018-07-06T13:58:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-10T03:46:02.000Z (over 7 years ago)
- Last Synced: 2025-04-11T12:52:34.500Z (7 months ago)
- Topics: orleans, swagger, swashbuckle
- Language: C#
- Homepage: https://github.com/domaindrivendev/Swashbuckle.AspNetCore
- Size: 34.2 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Swashbuckle.Orleans.SwaggerGen
## Orleans based on Swashbuckle survival Swagger document component
IServiceCollection configuration.
```
IServiceCollection services = new ServiceCollection();
services.AddTransient();
services.AddOrleansSwaggerGen((OrleansSwaggerGenOptions options) =>
{
options.GrainAssembly = typeof(UserService).Assembly;
options.DocumentName = "uc";
options.Host = "www.xxx.com/cotc";
options.Schemes.Add("http");
options.GrainInterfaceGrainKeyAsName.Add(typeof(IUserService), new GrainKeyDescription("userId", "User Id", "UserList"));
},
(SwaggerGenOptions options) =>
{
var basePath = Path.GetDirectoryName(typeof(IUserService).Assembly.Location);
var xmlPath = Path.Combine(basePath, "User.xml");
options.SwaggerDoc("cotc", new Swashbuckle.AspNetCore.Swagger.Info()
{
Title = "User API",
Version = "1.0.0"
});
options.IncludeXmlComments(xmlPath);
});
var serviceProvider = services.BuildServiceProvider();
var ser = serviceProvider.GetRequiredService();
string json = await ser.Generator();
```