0
간단한 Swagger API 문서. 게시물을 수행하고 작업을 넣을 동안 매개 변수 내 컨트롤러에 전달하지 (가져 오기 및 삭제 작업을 잘 수행)POST/PUT 본문 매개 변수가 내 컨트롤러로 전달되지 않습니다.
Swaggerjson 파일 :.
"paths": {
"/api/AddEmployee": {
"post": {
"summary": "Add an Employee",
"description": "Adds a new Employee to the employees list.",
"consumes": [
"application/x-www-form-urlencoded"
],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"description": "An Employee to create.",
"schema": {
"$ref": "#/definitions/Employee"
}
}
],
"responses": {
"200": {
"description": "Employee Added Sucessfully"
}
}
}
},
"/api/UpdateEmployee": {
"post": {
"summary": "Update an Employee",
"description": "Updates an exist employee",
"consumes": [
"application/x-www-form-urlencoded"
],
"parameters": [
{
"name": "body",
"in": "body",
"description": "An Employee to be updated.",
"schema": {
"$ref": "#/definitions/Employees"
}
}
],
"responses": {
"200": {
"description": "Employee Added Sucessfully"
}
}
}
}
},
"definitions": {
"Employees": {
"type": "object",
"properties": {
"EmpId": {
"type": "integer",
"format": "int32"
},
"FirstName": {
"type": "string"
},
"LastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
},
"Employee": {
"Type": "object",
"required": [
"FirstName",
"LastName",
"age"
],
"properties": {
"FirstName": {
"type": "string"
},
"LastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
}
}
수있는이 문제에 어떤 하나의 가이드. 티아!
WebApi를 사용하고 계신지요? 그렇다면 요청을받을 것으로 예상되는 컨트롤러, 작업 및 경로 세부 정보를 게시 할 수 있습니까? 문제가있을 수 있습니다. –
@ PhilCooper가 업데이트되었습니다. 지금 확인해 주시겠습니까? – k11k2