优化Swagger文档输出
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Nancy;
|
||||
using Nancy.Bootstrapper;
|
||||
using Nancy.Configuration;
|
||||
using Nancy.Conventions;
|
||||
using Nancy.Json;
|
||||
using Nancy.Swagger.Annotations;
|
||||
using Nancy.Swagger.Services;
|
||||
using Nancy.TinyIoc;
|
||||
@@ -25,9 +27,16 @@ namespace 电子展板.WebModule
|
||||
|
||||
protected override void ConfigureConventions(NancyConventions nancyConventions)
|
||||
{
|
||||
//... 配置你自己的静态文件等
|
||||
base.ConfigureConventions(nancyConventions);
|
||||
}
|
||||
|
||||
public override void Configure(INancyEnvironment environment)
|
||||
{ //保留属性原始的命名方式,下面两个都得配置,默认都是首字母小写的
|
||||
SwaggerAnnotationsConfig.RetainCasing = true;
|
||||
environment.Json(defaultEncoding: System.Text.Encoding.UTF8, retainCasing: true);
|
||||
base.Configure(environment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许跨域
|
||||
|
||||
Reference in New Issue
Block a user