Closed fcatae closed 7 years ago
The problem happens in the AddItem method.
public IActionResult AddItem(string folderId, [FromBody,Required] AddItemInput workloadInput)
{
if (folderId == null || folderId == "")
return BadRequest("folderId is empty");
...
...
...
return CreatedAtRoute("GetItem", new { itemId = workload.Id }, workload);
}
Solution:
Add the attribute ProducesResponseType
to the method in order to indicate the return type:
[HttpPost("{folderId}/add")]
[ProducesResponseType(typeof(WorkspaceItem), 201)]
[ProducesResponseType(typeof(string), 400)]
public IActionResult AddItem(string folderId, [FromBody,Required] AddItemInput workloadInput)
{
...
...
The swagger.json will reflect the code, and AutoRest will produce the correct code. ArdaSDK client will work correctly.
The problem happens in the integration test for AddItem method.