ナンシーv 1.4.1とNancy.Swagger v 2.1.1(ナンシーv1をサポートする最後のもの)を使用すると、上記のエラーが/ api-docsパス。何か案は?私が見たセットアップのステップでは、「パス」フィールドについて何も言わない。Swagger.ObjectModel.Builders.RequiredFieldException: 'Paths'が必要です
マイモジュール:
public class General : NancyModule
{
public General()
{
Get["/","Home"] = parameters =>
{
try
{
return "home";// View["view/index.html"];
}
catch (Exception ex)
{
return ExceptionHelper.ExceptionResponse(Negotiate, ex);
}
};
Get["/test/", "Test"] = parameters => {
return "testie";
};
}
}
私のモジュールのメタデータ:
public class GeneralMetadataModule : MetadataModule<PathItem>
{
public GeneralMetadataModule(ISwaggerModelCatalog modelCatalog)
{
Describe["Test"] = description => description.AsSwagger(
with => with.Operation(
op => op.OperationId("Test")
.Tag("Users")
.Summary("The list of users")
.Description("This returns a list of users from our awesome app")));
}
}
スタックトレース:
Nancy.RequestExecutionException:ああNOEが! ---> Swagger.ObjectModel.Builders.RequiredFieldException: 'パス'が必要です。 でSwagger.ObjectModel.Builders.SwaggerRootBuilder.Build()C:\ projects \ nancy-swagger \ src \ Swagger.ObjectModel \ Builders \ SwaggerRootBuilder.cs:line 123 Nancy.Swagger.Services.SwaggerMetadataProvider.GetSwaggerJson() C:¥projects¥nancy-swagger¥src¥Nancy.Swagger¥Services¥SwaggerMetadataProvider.cs:行91 (Nancy.Swagger.Modules.SwaggerModule)にあります。 <> c__DisplayClass0_0。 (Closure、CallSite、Func`2、Object)の .ctor> b__0(Object _)C:¥projects¥nancy-swagger¥src¥Nancy.Swagger¥Modules¥SwaggerModule.cs:11行目 Nancy.Routing.Routeで。 <> c__DisplayClass4.b__3(オブジェクトのパラメータ、CancellationTokenコンテキスト) ---内部例外スタックトレースの終わり--- Nancy.NancyEngine.InvokeOnErrorHookで (NancyContextコンテキスト、ErrorPipelineパイプライン、例外EX)
おかげで最初にする必要があります。あなたがここ1ヶ月前にLOLにいたことを祈って –