Exemplo n.º 1
0
        public ApiDeclaration GetApi(string controllerName)
        {
            var r = SwaggerGen.CreateApiDeclaration(ControllerContext);
            var actions = _apiDescriptions.Where(
                    a => a.ActionDescriptor.ControllerDescriptor.ControllerName
                            .Equals(controllerName,StringComparison.InvariantCultureIgnoreCase)
                );

            var swaggerGen = new SwaggerGen();

            r.Apis = actions.Select(swaggerGen.CreateApi);
            r.Models = ModelGen.CreateModels(actions, _docProvider);

            return r;
        }
Exemplo n.º 2
0
        public ApiDeclaration GetApi(string controllerName)
        {
            var r       = SwaggerGen.CreateApiDeclaration(ControllerContext);
            var actions = _apiDescriptions.Where(
                a => a.ActionDescriptor.ControllerDescriptor.ControllerName
                .Equals(controllerName, StringComparison.InvariantCultureIgnoreCase)
                );

            var swaggerGen = new SwaggerGen();

            r.Apis   = actions.Select(swaggerGen.CreateApi);
            r.Models = ModelGen.CreateModels(actions, _docProvider);

            return(r);
        }