/// <summary> /// Swagger描述 /// </summary> /// <param name="options">选项</param> public Swagger(SwaggerOptions options) : this(GetDocument(options.Swagger)) { if (string.IsNullOrEmpty(options.Namespace) == false) { this.Settings.NameSpace = options.Namespace; this.Settings.CSharpGeneratorSettings.Namespace = options.Namespace; } }
static void Main(string[] args) { var options = new SwaggerOptions(); if (Parser.Default.ParseArguments(args, options)) { var swagger = new Swagger(options); swagger.GenerateFiles(); } else { Console.WriteLine(options.GetUsage()); Console.Read(); } }