का उपयोग कर स्वैगर (एएसपी.नेट कोर) सेट अप करना मेरे पास एक वेब एपीआई (एएसपी.नेट कोर) है और मैं इसे कॉल करने के लिए स्वैगर समायोजित करने की कोशिश कर रहा हूं। कॉल में प्राधिकरण शीर्षलेख होना चाहिए और मैं बेयरर प्रमाणीकरण का उपयोग कर रहा हूं। पोस्टमैन आदि जैसे तृतीय पक्ष ऐप्स से कॉल ठीक हो जाते हैं। लेकिन मुझे हेडर्स को स्वैगर के लिए सेट करने में समस्या है (किसी कारण से मुझे हेडर नहीं मिलते हैं)। यह है कि यह कैसे अब की तरह लग रहा है:प्राधिकरण शीर्षलेख (बीयर)
सभी की"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
}
},
आपकी व्याख्या ने मेरे लिए समस्या हल कर दी है। –
अच्छा जवाब लेकिन जब मैं एबीपी बॉयलरप्लेट के साथ ऐसा करता हूं, तो यह डायनामिक वेब एपी (https://aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API) –
@VadimK के साथ काम नहीं करता है जब तक कि मैं अपग्रेड नहीं करता .NET कोर 2.0 – monty