Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

csharp-rest-client-builder

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csharp-rest-client-builder

用于生成C#,RestApiClient客户端库的代码生成器

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

C# RestApiClient代码生成器

用于生成C#,RestApiClient客户端库的代码生成器

该生成器使用nodejs编写,使用前请安装Nodejs。 使用 jojoin/tppl 模板引擎生成代码。

与VisualStudio自带生成器对比

  • 支持net framework 4.0(XP系统应用开发必须)
  • 可配置
  • 可脱离visual studio环境运行

使用方法

安装:


# 安装到全局npm
npm install --global csharp-rest-client-builder

生成:

# 生成http://your-host.com/swagger/docs/v1到默认目录(outputs)下
restapi-build http://your-host.com/swagger/docs/v1

您还可以使用以下命令查看命令说明

restapi-build --help

生成后的代码依赖以下库运行:

  • RestSharp@105.2.3.0
  • Newtonsoft.Json@8.0.3

请为使用代码的项目添加以上Nuget依赖。

配置文件

本工具还支持配置文件,配置路径为当前路径下的 .restapi.json 文件,
具体配置参考如下:

{
    // swagger服务器地址
    "swaggerUrl": "http://your-host.com/swagger/docs/v1",
    // 客户端默认命名空间(完整命名空间),ApiClient类存于此处,默认值: RestApiClient
    "clientNamespace": "RestApiClient",
    // Models的子命名空间(仅须填写子命名空间),默认值:ClientModels
    "modelsNamespace": "ClientModels",
    // 生成的文件输出路径,默认值:outputs
    "outputDir": "../",
    // Models的输出路径,默认值:ClientModels
    "modelsDir": "ClientModels"
}

FAQs

Package last updated on 27 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc