Beispiel #1
0
 public SwaggerGenerator(
     IApiDescriptionGroupCollectionProvider apiDescriptionsProvider,
     ISchemaRegistryFactory schemaRegistryFactory,
     SwaggerGeneratorSettings settings = null)
 {
     _apiDescriptionsProvider = apiDescriptionsProvider;
     _schemaRegistryFactory   = schemaRegistryFactory;
     _settings = settings ?? new SwaggerGeneratorSettings();
 }
Beispiel #2
0
        public SwaggerGenOptions()
        {
            _swaggerGeneratorSettings = new SwaggerGeneratorSettings();
            _schemaRegistrySettings   = new SchemaRegistrySettings();

            _xmlDocFactories            = new List <Func <XPathDocument> >();
            _parameterFilterDescriptors = new List <FilterDescriptor <IParameterFilter> >();
            _operationFilterDescriptors = new List <FilterDescriptor <IOperationFilter> >();
            _documentFilterDescriptors  = new List <FilterDescriptor <IDocumentFilter> >();
            _schemaFilterDescriptors    = new List <FilterDescriptor <ISchemaFilter> >();
        }
        public SwaggerGenOptions()
        {
            _swaggerGeneratorSettings = new SwaggerGeneratorSettings();
            _schemaRegistrySettings = new SchemaRegistrySettings();

            _xmlDocFactories = new List<Func<XPathDocument>>();
            _operationFilterDescriptors = new List<FilterDescriptor<IOperationFilter>>();
            _documentFilterDescriptors = new List<FilterDescriptor<IDocumentFilter>>();
            _schemaFilterDescriptors = new List<FilterDescriptor<ISchemaFilter>>();

            // Enable Annotations
            OperationFilter<SwaggerAttributesOperationFilter>();
            OperationFilter<SwaggerResponseAttributeFilter>();
            SchemaFilter<SwaggerAttributesSchemaFilter>();
        }