Ejemplo n.º 1
0
        private SwaggerPathDescriptor CreatePathDescriptor(Info info, string basePath)
        {
            var pathBuilder = new StringBuilder("/" + _routeTemplate.Replace("{apiVersion}", info.Version));
            if (basePath != null)
                pathBuilder.Insert(0, basePath);

            return new SwaggerPathDescriptor { Path = pathBuilder.ToString(), Info = info };
        }
 public SwaggerGeneratorOptions(
     Func<ApiDescription, string> resourceNameResolver,
     IComparer<string> resourceNameComparer,
     IDictionary<Type, Func<DataType>> customTypeMappings,
     IEnumerable<PolymorphicType> polymorphicTypes,
     IEnumerable<IModelFilter> modelFilters,
     IEnumerable<IOperationFilter> operationFilters,
     Info apiInfo,
     IDictionary<string, Authorization> authorizations)
 {
     ResourceNameResolver = resourceNameResolver;
     ResourceNameComparer = resourceNameComparer;
     CustomTypeMappings = customTypeMappings;
     PolymorphicTypes = polymorphicTypes;
     ModelFilters = modelFilters;
     OperationFilters = operationFilters;
     ApiInfo = apiInfo;
     Authorizations = authorizations;
 }
 public void SingleApiVersion(Info info)
 {
     _apiVersions.Clear();
     _apiVersions.Add(info);
     VersionSupportResolver = null;
 }