Web API'm var (ASP.NET Çekirdeği) ve arama yapmak için swagger'ı ayarlamaya çalışıyorum. Çağrılar Yetkilendirme üstbilgisini içermeli ve Taşıyıcı kimlik doğrulamasını kullanıyorum. Postman gibi üçüncü taraf uygulamaların çağrıları iyi gidiyor. Ancak sorun, swagger için üstbilgilerin ayarlanması ile ilgili sorun yaşıyorum (bazı nedenlerle başlıkları alamıyorum). Bu şimdiki gibi görünüyor: Her şeydenYetkilendirme üstbilgilerini (Bearer) kullanarak Swagger'ı (ASP.NET Çekirdeği) Kurma
"host": "localhost:50352",
"basePath": "/" ,
"schemes": [
"http",
"https"
],
"securityDefinitions": {
"Bearer": {
"name": "Authorization",
"in": "header",
"type": "apiKey",
"description": "HTTP/HTTPS Bearer"
}
},
"paths": {
"/v1/{subAccountId}/test1": {
"post": {
"tags": [
"auth"
],
"operationId": "op1",
"consumes": ["application/json", "application/html"],
"produces": ["application/json", "application/html"],
"parameters": [
{
"name": "subAccountId",
"in": "path",
"required": true,
"type": "string"
}
],
"security":[{
"Bearer": []
}],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "BadRequest",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "InternalServerError",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"deprecated": false
}
},
Açıklamanız benim için problemi çözdü. –
İyi bir yanıt ancak bunu ABP boilerplate ile yaptığımda, Dinamik Web Api (https://aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API) –
@VadimK ile çalışmaz. .NET Core 2.0 – monty