Umstellung auf Swagger 3
This commit is contained in:
@@ -4,12 +4,15 @@ Imports System.Linq
|
||||
Imports System.Web.Http
|
||||
Imports System.Web.Http.Dispatcher
|
||||
Imports System.Web.Http.Routing
|
||||
Imports System.Web.Routing
|
||||
Imports Microsoft.Extensions.DependencyInjection
|
||||
Imports Microsoft.Web.Http
|
||||
Imports Microsoft.Web.Http.Routing
|
||||
Imports Microsoft.Web.Http.Versioning
|
||||
Imports Swashbuckle.Application
|
||||
Imports Swashbuckle.Swagger
|
||||
Imports NSwag
|
||||
Imports NSwag.AspNet.Owin
|
||||
|
||||
Public Module WebApiConfig
|
||||
|
||||
@@ -56,7 +59,9 @@ Public Module WebApiConfig
|
||||
|
||||
|
||||
|
||||
Public Sub Register(ByVal config As HttpConfiguration)
|
||||
Public Sub Register3(ByVal config As HttpConfiguration)
|
||||
|
||||
|
||||
|
||||
Dim constraintsResolver = New DefaultInlineConstraintResolver()
|
||||
constraintsResolver.ConstraintMap.Add("apiVersion", GetType(ApiVersionRouteConstraint))
|
||||
@@ -85,11 +90,25 @@ Public Module WebApiConfig
|
||||
|
||||
|
||||
|
||||
SwaggerConfig.Register(config)
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Register(ByVal config As HttpConfiguration)
|
||||
|
||||
SwaggerConfig.Register(config)
|
||||
|
||||
Dim constraintsResolver = New DefaultInlineConstraintResolver()
|
||||
constraintsResolver.ConstraintMap.Add("apiVersion", GetType(ApiVersionRouteConstraint))
|
||||
|
||||
|
||||
config.MapHttpAttributeRoutes(constraintsResolver)
|
||||
'config.Filters.Add(New AuthorizeAttribute) 'wenn alle API Aufrufe autorisiert werden müssen/ansonsten können einzelene Controlleraufrufe auth. werden!
|
||||
config.Filters.Add(New BasicAuthenticationAttribute())
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
||||
Reference in New Issue
Block a user