예제 #1
0
 /// <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;
     }
 }
예제 #2
0
        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();
            }
        }