コード例 #1
0
        /// <summary>Initializes a new instance of the <see cref="OpenApiDocumentMiddleware"/> class.</summary>
        /// <param name="nextDelegate">The next delegate.</param>
        /// <param name="serviceProvider">The service provider.</param>
        /// <param name="documentName">The document name.</param>
        /// <param name="path">The document path.</param>
        /// <param name="settings">The settings.</param>
        public OpenApiDocumentMiddleware(RequestDelegate nextDelegate, IServiceProvider serviceProvider, string documentName, string path, OpenApiDocumentMiddlewareSettings settings)
        {
            _nextDelegate = nextDelegate;

            _documentName = documentName;
            _path         = path;

            _apiDescriptionGroupCollectionProvider = serviceProvider.GetService <IApiDescriptionGroupCollectionProvider>() ??
                                                     throw new InvalidOperationException("API Explorer not registered in DI.");
            _documentProvider = serviceProvider.GetService <OpenApiDocumentProvider>() ??
                                throw new InvalidOperationException("The NSwag DI services are not registered: Call " + nameof(NSwagServiceCollectionExtensions.AddSwaggerDocument) + "() in ConfigureServices().");

            _settings = settings;
        }
 public OrchardCoreOpenApiDocumentMiddleware(RequestDelegate nextDelegate, IServiceProvider serviceProvider, string documentName, string path, OpenApiDocumentMiddlewareSettings settings) :
     base(nextDelegate, serviceProvider, documentName, path, settings)
 {
 }
コード例 #3
0
 protected virtual void OpenApiSetting(OpenApiDocumentMiddlewareSettings options)
 {
 }
コード例 #4
0
 /// <summary>Configure SwaggerUI API Interface.</summary>
 /// <param name="settings"><see cref="OpenApiDocumentMiddlewareSettings"/>.</param>
 protected virtual void ConfigureOpenApi(OpenApiDocumentMiddlewareSettings settings)
 {
 }