首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从Autorest生成C#客户端?

如何从Autorest生成C#客户端?
EN

Stack Overflow用户
提问于 2018-05-27 05:07:07
回答 1查看 703关注 0票数 0

为了解决this question问题,我认为我需要为api生成一个客户端sdk。

我已经安装了Autorest,并且正在尝试命令

代码语言:javascript
复制
AutoRest -mynamespace mytrack.Client -CodeGenerator CSharp -Modeler 
Swagger -Input swagger.json -PackageName mytrack.client -AddCredentials true

结果是

代码语言:javascript
复制
AutoRest code generation utility [version: 2.0.4262; node: v10.1.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
(node:9764) ExperimentalWarning: The fs.promises API is experimental
ERROR: Schema violation: Object didn't pass validation for format email:
    - file:///C:/dev/autoresttest/swagger.json:1:156 ($.info.contact.email)
FATAL: swagger-document/individual/schema-validator - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
(node:9764) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 10)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 11)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 12)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 13)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 14)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 15)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 17)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 18)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 19)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 20)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 21)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 22)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 23)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 24)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 25)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
    at C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 26)
(node:9764) UnhandledPromiseRejectionWarning: TypeError: volume[member].bind is not a function
    at patchFilesystem (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:277:43)
    at C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:281:18
    at Object.global.staticloader.undo (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:163:7)
    at process.exit.n [as exit] (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:170:27)
    at main (C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4279\node_modules\@microsoft.azure\autorest-core\dist\app.js:514:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 27)
Shutting Down
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-27 05:28:09

我把电子邮件放在了SwaggerDoc中的Swagger联系信息集中

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50549179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档