0

我正在尝试构建一个应用程序来从 EOSIO 区块链获取数据。它的 API 记录在这里:https ://developers.eos.io/manuals/eos/latest/nodeos/plugins/chain_api_plugin/api-reference/index

文档包括 API 的可下载 JSON OpenAPI 规范。

我尝试将该规范作为服务引用添加到 Visual Studio 2019(版本 16.8.1)中。这会自动安装 NSwag.ApiDescription.Client 13.0.5 及其依赖项。

在构建时,我收到以下错误:

1>System.InvalidOperationException: Could not resolve the path '#/paths/~1get_abi/post/requestBody/content/application~1json/schema/properties/account_name'.
1>   at NJsonSchema.JsonReferenceResolver.ResolveDocumentReference(Object rootObject, String jsonPath)
1>   at NJsonSchema.JsonReferenceResolver.<ResolveReferenceAsync>d__10.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.JsonReferenceResolver.<ResolveReferenceAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.JsonSchemaReferenceUtilities.JsonReferenceUpdater.<VisitJsonReferenceAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Visitors.AsyncJsonReferenceVisitorBase.<VisitAsync>d__3.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.JsonSchemaReferenceUtilities.JsonReferenceUpdater.<VisitAsync>d__4.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.JsonSchemaReferenceUtilities.<UpdateSchemaReferencesAsync>d__1.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NJsonSchema.Infrastructure.JsonSchemaSerialization.<FromJsonAsync>d__13`1.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.OpenApiDocument.<FromJsonAsync>d__57.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.OpenApiDocument.<FromFileAsync>d__58.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.Commands.OutputCommandBase.<ReadSwaggerDocumentAsync>d__5.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.Commands.InputOutputCommandBase.<GetInputSwaggerDocument>d__12.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.Commands.CodeGeneration.SwaggerToCSharpClientCommand.<<RunAsync>b__83_0>d.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.Commands.CodeGeneration.SwaggerToCSharpClientCommand.<RunAsync>d__83.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NSwag.Commands.CodeGeneration.SwaggerToCSharpClientCommand.<RunAsync>d__82.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NConsole.CommandLineProcessor.<ProcessSingleAsync>d__12.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NConsole.CommandLineProcessor.<ProcessAsync>d__11.MoveNext()
1>--- End of stack trace from previous location where exception was thrown ---
1>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
1>   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>   at NConsole.CommandLineProcessor.Process(String[] args, Object input)
1>   at NSwag.Commands.NSwagCommandProcessor.Process(String[] args)

我检查了路径“#/paths/~1get_abi/post/requestBody/content/application~1json/schema/properties/account_name”,它似乎是有效的。

如何让客户端生成?

——雅各布

4

0 回答 0