...@@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Controllers ...@@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Controllers
{ {
/// <summary> /// <summary>
/// Get the version of the server. /// Get the state of the server.
/// </summary> /// </summary>
/// <response code="200">OK, world storage server ready.</response> /// <response code="200">OK, world storage server ready.</response>
[HttpGet] [HttpGet]
...@@ -67,13 +67,14 @@ namespace Org.OpenAPITools.Controllers ...@@ -67,13 +67,14 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Test the server availability /// Test the server availability.
/// </summary> /// </summary>
/// <response code="200">OK, world storage alive.</response> /// <response code="200">Ok, returns a string message.</response>
[HttpGet] [HttpGet]
[Route("/ping")] [Route("/ping")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetPing")] [SwaggerOperation("GetPing")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "Ok, returns a string message.")]
public override IActionResult GetPing() public override IActionResult GetPing()
{ {
string answer = "OK, world storage alive."; string answer = "OK, world storage alive.";
......
...@@ -63,10 +63,11 @@ namespace Org.OpenAPITools.Controllers ...@@ -63,10 +63,11 @@ namespace Org.OpenAPITools.Controllers
/// <summary> /// <summary>
/// Create a trackable /// Create a Trackable.
/// </summary> /// </summary>
/// <param name="trackable">The trackable to be added to the world storage.</param> /// <remarks>Create a new Trackable from a json object containing all the required informations and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created Trackable.</remarks>
/// <response code="200">OK, returns the UUID of the Trackable defined by the world storage.</response> /// <param name="trackable">The Trackable to be added to the world storage.</param>
/// <response code="200">OK, return the UUID of the Trackable defined by the world storage.</response>
/// <response code="201">Null response.</response> /// <response code="201">Null response.</response>
/// <response code="400">Bad request.</response> /// <response code="400">Bad request.</response>
/// <response code="409">Invalid UUID, id must be a Nil value.</response> /// <response code="409">Invalid UUID, id must be a Nil value.</response>
...@@ -76,7 +77,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -76,7 +77,10 @@ namespace Org.OpenAPITools.Controllers
[Consumes("application/json")] [Consumes("application/json")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("AddTrackable")] [SwaggerOperation("AddTrackable")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, returns the UUID of the Trackable defined by the world storage.")] [SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, return the UUID of the Trackable defined by the world storage.")]
[SwaggerResponse(statusCode: 201, type: typeof(string), description: "Null response.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Bad request.")]
[SwaggerResponse(statusCode: 409, type: typeof(string), description: "Invalid UUID, id must be a Nil value.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult AddTrackable([FromBody] Trackable trackable) public override IActionResult AddTrackable([FromBody] Trackable trackable)
{ {
...@@ -87,17 +91,18 @@ namespace Org.OpenAPITools.Controllers ...@@ -87,17 +91,18 @@ namespace Org.OpenAPITools.Controllers
try try
{ {
Trackable mytrackable = _trackableService.Create(trackable); Trackable mytrackable = _trackableService.Create(trackable);
return new ObjectResult(mytrackable); return StatusCode(200, mytrackable.UUID.ToString());
} }
catch (Exception e) catch (Exception e)
{ {
return StatusCode(400, e.Message); return StatusCode(400, e.Message);
} }
} }
/// <summary> /// <summary>
/// Deletes a trackable. /// Delete a Trackable.
/// </summary> /// </summary>
/// <remarks>Delete a single Trackable stored in the world storage from its ID.</remarks>
/// <param name="trackableUUID">Trackable UUID to delete.</param> /// <param name="trackableUUID">Trackable UUID to delete.</param>
/// <response code="200">OK, delete successful.</response> /// <response code="200">OK, delete successful.</response>
/// <response code="400">Invalid UUID supplied.</response> /// <response code="400">Invalid UUID supplied.</response>
...@@ -106,6 +111,9 @@ namespace Org.OpenAPITools.Controllers ...@@ -106,6 +111,9 @@ namespace Org.OpenAPITools.Controllers
[Route("/trackables/{trackableUUID}")] [Route("/trackables/{trackableUUID}")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("DeleteTrackable")] [SwaggerOperation("DeleteTrackable")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, delete successful.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Invalid UUID supplied.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
public override IActionResult DeleteTrackable([FromRoute(Name = "trackableUUID")][Required] Guid trackableUUID) public override IActionResult DeleteTrackable([FromRoute(Name = "trackableUUID")][Required] Guid trackableUUID)
{ {
DeleteResult answer = _trackableService.Remove(trackableUUID); DeleteResult answer = _trackableService.Remove(trackableUUID);
...@@ -136,9 +144,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -136,9 +144,10 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Find a trackable by its UUID. /// Find a Trackable by its UUID.
/// </summary> /// </summary>
/// <param name="trackableUUID">UUID of the trackable to retrieve.</param> /// <remarks>Get a single Trackable stored in the world storage from its ID.</remarks>
/// <param name="trackableUUID">UUID of the Trackable to retrieve.</param>
/// <response code="200">Successful operation.</response> /// <response code="200">Successful operation.</response>
/// <response code="400">Invalid UUID supplied.</response> /// <response code="400">Invalid UUID supplied.</response>
/// <response code="404">Not found, could not find UUID in database.</response> /// <response code="404">Not found, could not find UUID in database.</response>
...@@ -147,6 +156,8 @@ namespace Org.OpenAPITools.Controllers ...@@ -147,6 +156,8 @@ namespace Org.OpenAPITools.Controllers
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetTrackableById")] [SwaggerOperation("GetTrackableById")]
[SwaggerResponse(statusCode: 200, type: typeof(Trackable), description: "Successful operation.")] [SwaggerResponse(statusCode: 200, type: typeof(Trackable), description: "Successful operation.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Invalid UUID supplied.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
public override IActionResult GetTrackableById([FromRoute(Name = "trackableUUID")][Required] Guid trackableUUID) public override IActionResult GetTrackableById([FromRoute(Name = "trackableUUID")][Required] Guid trackableUUID)
{ {
Trackable trackable = _trackableService.Get(trackableUUID); Trackable trackable = _trackableService.Get(trackableUUID);
...@@ -154,16 +165,18 @@ namespace Org.OpenAPITools.Controllers ...@@ -154,16 +165,18 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// returns the list of all trackables defined by the world storage. /// Return all the Trackables.
/// </summary> /// </summary>
/// <response code="200">OK, returns all the Trackables defined by the world storage.</response> /// <remarks>Get all the Trackables currently being stored in the world storage.</remarks>
/// <response code="200">OK, return all the Trackables defined by the world storage.</response>
/// <response code="201">Null response.</response> /// <response code="201">Null response.</response>
/// <response code="0">Unexpected error.</response> /// <response code="0">Unexpected error.</response>
[HttpGet] [HttpGet]
[Route("/trackables")] [Route("/trackables")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetTrackables")] [SwaggerOperation("GetTrackables")]
[SwaggerResponse(statusCode: 200, type: typeof(List<Trackable>), description: "OK, returns all the Trackables defined by the world storage.")] [SwaggerResponse(statusCode: 200, type: typeof(List<Trackable>), description: "OK, return all the Trackables defined by the world storage.")]
[SwaggerResponse(statusCode: 201, type: typeof(string), description: "Null response.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult GetTrackables() public override IActionResult GetTrackables()
{ {
...@@ -187,6 +200,9 @@ namespace Org.OpenAPITools.Controllers ...@@ -187,6 +200,9 @@ namespace Org.OpenAPITools.Controllers
[Consumes("application/json")] [Consumes("application/json")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("ModifyTrackable")] [SwaggerOperation("ModifyTrackable")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, return the UUID of the modified Trackable.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Bad request.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult ModifyTrackable([FromBody] Trackable trackable) public override IActionResult ModifyTrackable([FromBody] Trackable trackable)
{ {
...@@ -197,7 +213,7 @@ namespace Org.OpenAPITools.Controllers ...@@ -197,7 +213,7 @@ namespace Org.OpenAPITools.Controllers
} }
else else
{ {
return StatusCode(200, trackable.UUID); return StatusCode(200, trackable.UUID.ToString());
} }
} }
} }
......
...@@ -63,10 +63,11 @@ namespace Org.OpenAPITools.Controllers ...@@ -63,10 +63,11 @@ namespace Org.OpenAPITools.Controllers
/// <summary> /// <summary>
/// Create a world anchor. /// Create a World Anchor.
/// </summary> /// </summary>
/// <param name="worldAnchor">The world anchor to be added to the world storage.</param> /// <remarks>Create a new World Anchor from a json object containing all the required informations and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Anchor.</remarks>
/// <response code="200">OK, returns the UUID of the World Anchor defined by the world storage.</response> /// <param name="worldAnchor">The World Anchor to be added to the world storage.</param>
/// <response code="200">OK, return the UUID of the World Anchor defined by the world storage.</response>
/// <response code="201">Null response.</response> /// <response code="201">Null response.</response>
/// <response code="400">Bad request.</response> /// <response code="400">Bad request.</response>
/// <response code="409">Invalid UUID, id must be a Nil value.</response> /// <response code="409">Invalid UUID, id must be a Nil value.</response>
...@@ -76,7 +77,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -76,7 +77,10 @@ namespace Org.OpenAPITools.Controllers
[Consumes("application/json")] [Consumes("application/json")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("AddWorldAnchor")] [SwaggerOperation("AddWorldAnchor")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, returns the UUID of the World Anchor defined by the world storage.")] [SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, return the UUID of the World Anchor defined by the world storage.")]
[SwaggerResponse(statusCode: 201, type: typeof(string), description: "Null response.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Bad request.")]
[SwaggerResponse(statusCode: 409, type: typeof(string), description: "Invalid UUID, id must be a Nil value.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult AddWorldAnchor([FromBody] WorldAnchor worldAnchor) public override IActionResult AddWorldAnchor([FromBody] WorldAnchor worldAnchor)
{ {
...@@ -87,7 +91,7 @@ namespace Org.OpenAPITools.Controllers ...@@ -87,7 +91,7 @@ namespace Org.OpenAPITools.Controllers
try try
{ {
WorldAnchor myworldanchor = _worldAnchorService.Create(worldAnchor); WorldAnchor myworldanchor = _worldAnchorService.Create(worldAnchor);
return new ObjectResult(myworldanchor); return StatusCode(200, myworldanchor.UUID.ToString());
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -96,9 +100,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -96,9 +100,10 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Deletes a world anchor. /// Delete a World Anchor.
/// </summary> /// </summary>
/// <param name="worldAnchorUUID">World anchor UUID to delete.</param> /// <remarks>Delete a single World Anchor stored in the world storage from its ID.</remarks>
/// <param name="worldAnchorUUID">World Anchor UUID to delete.</param>
/// <response code="200">OK, delete successful.</response> /// <response code="200">OK, delete successful.</response>
/// <response code="400">Invalid UUID supplied.</response> /// <response code="400">Invalid UUID supplied.</response>
/// <response code="404">Not found, could not find UUID in database.</response> /// <response code="404">Not found, could not find UUID in database.</response>
...@@ -106,6 +111,9 @@ namespace Org.OpenAPITools.Controllers ...@@ -106,6 +111,9 @@ namespace Org.OpenAPITools.Controllers
[Route("/worldAnchors/{worldAnchorUUID}")] [Route("/worldAnchors/{worldAnchorUUID}")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("DeleteWorldAnchor")] [SwaggerOperation("DeleteWorldAnchor")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, delete successful.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Invalid UUID supplied.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
public override IActionResult DeleteWorldAnchor([FromRoute(Name = "worldAnchorUUID")][Required] Guid worldAnchorUUID) public override IActionResult DeleteWorldAnchor([FromRoute(Name = "worldAnchorUUID")][Required] Guid worldAnchorUUID)
{ {
DeleteResult answer = _worldAnchorService.Remove((worldAnchorUUID)); DeleteResult answer = _worldAnchorService.Remove((worldAnchorUUID));
...@@ -136,9 +144,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -136,9 +144,10 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Find a world anchor by its UUID. /// Find a World Anchor by its UUID.
/// </summary> /// </summary>
/// <param name="worldAnchorUUID">UUID of the world anchor to retrieve.</param> /// <remarks>Get a single World Anchor stored in the world storage from its ID.</remarks>
/// <param name="worldAnchorUUID">UUID of the World Anchor to retrieve.</param>
/// <response code="200">Successful operation.</response> /// <response code="200">Successful operation.</response>
/// <response code="400">Invalid UUID supplied.</response> /// <response code="400">Invalid UUID supplied.</response>
/// <response code="404">Not found, could not find UUID in database.</response> /// <response code="404">Not found, could not find UUID in database.</response>
...@@ -147,6 +156,8 @@ namespace Org.OpenAPITools.Controllers ...@@ -147,6 +156,8 @@ namespace Org.OpenAPITools.Controllers
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetWorldAnchorById")] [SwaggerOperation("GetWorldAnchorById")]
[SwaggerResponse(statusCode: 200, type: typeof(WorldAnchor), description: "Successful operation.")] [SwaggerResponse(statusCode: 200, type: typeof(WorldAnchor), description: "Successful operation.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Invalid UUID supplied.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
public override IActionResult GetWorldAnchorById([FromRoute(Name = "worldAnchorUUID")][Required] Guid worldAnchorUUID) public override IActionResult GetWorldAnchorById([FromRoute(Name = "worldAnchorUUID")][Required] Guid worldAnchorUUID)
{ {
WorldAnchor myworldanchor = _worldAnchorService.Get(worldAnchorUUID); WorldAnchor myworldanchor = _worldAnchorService.Get(worldAnchorUUID);
...@@ -154,16 +165,18 @@ namespace Org.OpenAPITools.Controllers ...@@ -154,16 +165,18 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Returns the list of all world anchors defined by the world storage. /// Return all the World Anchors.
/// </summary> /// </summary>
/// <response code="200">OK, returns all the world anchors defined by the world storage.</response> /// <remarks>Get all the World Anchors currently being stored in the world storage.</remarks>
/// <response code="200">OK, return all the World Anchors defined by the world storage.</response>
/// <response code="201">Null response.</response> /// <response code="201">Null response.</response>
/// <response code="0">Unexpected error.</response> /// <response code="0">Unexpected error.</response>
[HttpGet] [HttpGet]
[Route("/worldAnchors")] [Route("/worldAnchors")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetWorldAnchors")] [SwaggerOperation("GetWorldAnchors")]
[SwaggerResponse(statusCode: 200, type: typeof(List<WorldAnchor>), description: "OK, returns all the world anchors defined by the world storage.")] [SwaggerResponse(statusCode: 200, type: typeof(List<WorldAnchor>), description: "OK, return all the World Anchors defined by the world storage.")]
[SwaggerResponse(statusCode: 201, type: typeof(string), description: "Null response.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult GetWorldAnchors() public override IActionResult GetWorldAnchors()
{ {
...@@ -187,6 +200,9 @@ namespace Org.OpenAPITools.Controllers ...@@ -187,6 +200,9 @@ namespace Org.OpenAPITools.Controllers
[Consumes("application/json")] [Consumes("application/json")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("ModifyWorldAnchor")] [SwaggerOperation("ModifyWorldAnchor")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, return the UUID of the modified World Anchor.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Bad request.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult ModifyWorldAnchor([FromBody] WorldAnchor worldAnchor) public override IActionResult ModifyWorldAnchor([FromBody] WorldAnchor worldAnchor)
{ {
...@@ -197,7 +213,7 @@ namespace Org.OpenAPITools.Controllers ...@@ -197,7 +213,7 @@ namespace Org.OpenAPITools.Controllers
} }
else else
{ {
return StatusCode(200, worldAnchor.UUID); return StatusCode(200, worldAnchor.UUID.ToString());
} }
} }
......
...@@ -62,11 +62,12 @@ namespace Org.OpenAPITools.Controllers ...@@ -62,11 +62,12 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Create a link between world anchors and trackables. /// Create a World Link between elements (world anchors and/or trackables).
/// </summary> /// </summary>
/// <remarks>Create a new World Link from a json object containing all the required informations and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Link.</remarks>
/// <param name="worldLink">The link to be added to the world storage.</param> /// <param name="worldLink">The link to be added to the world storage.</param>
/// <response code="200">OK, returns the UUID of the link defined by the world storage.</response> /// <response code="200">OK, return the UUID of the World Link defined by the world storage.</response>
/// <response code="201">Null response</response> /// <response code="201">Null response.</response>
/// <response code="400">Bad request.</response> /// <response code="400">Bad request.</response>
/// <response code="409">Invalid UUID, id must be a Nil value.</response> /// <response code="409">Invalid UUID, id must be a Nil value.</response>
/// <response code="0">Unexpected error.</response> /// <response code="0">Unexpected error.</response>
...@@ -75,7 +76,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -75,7 +76,10 @@ namespace Org.OpenAPITools.Controllers
[Consumes("application/json")] [Consumes("application/json")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("AddWorldLink")] [SwaggerOperation("AddWorldLink")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, returns the UUID of the link defined by the world storage.")] [SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, return the UUID of the World Link defined by the world storage.")]
[SwaggerResponse(statusCode: 201, type: typeof(string), description: "Null response.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Bad request.")]
[SwaggerResponse(statusCode: 409, type: typeof(string), description: "Invalid UUID, id must be a Nil value.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult AddWorldLink([FromBody] WorldLink worldLink) public override IActionResult AddWorldLink([FromBody] WorldLink worldLink)
{ {
...@@ -86,7 +90,7 @@ namespace Org.OpenAPITools.Controllers ...@@ -86,7 +90,7 @@ namespace Org.OpenAPITools.Controllers
try try
{ {
WorldLink myworldlink = _worldLinkService.Create(worldLink); WorldLink myworldlink = _worldLinkService.Create(worldLink);
return new ObjectResult(myworldlink); return StatusCode(200, myworldlink.UUID.ToString());
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -95,16 +99,20 @@ namespace Org.OpenAPITools.Controllers ...@@ -95,16 +99,20 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Deletes a worldLink. /// Delete a World Link.
/// </summary> /// </summary>
/// <param name="worldLinkUUID">link id to delete</param> /// <remarks>Delete a single World Link stored in the world storage from its ID.</remarks>
/// <response code="200">OK</response> /// <param name="worldLinkUUID">World Link id to delete.</param>
/// <response code="200">OK, delete successful.</response>
/// <response code="400">Invalid UUID supplied.</response> /// <response code="400">Invalid UUID supplied.</response>
/// <response code="404">Not found, could not find UUID in database.</response> /// <response code="404">Not found, could not find UUID in database.</response>
[HttpDelete] [HttpDelete]
[Route("/worldLinks/{worldLinkUUID}")] [Route("/worldLinks/{worldLinkUUID}")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("DeleteWorldLink")] [SwaggerOperation("DeleteWorldLink")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, delete successful.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Invalid UUID supplied.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
public override IActionResult DeleteWorldLink([FromRoute(Name = "worldLinkUUID")][Required] Guid worldLinkUUID) public override IActionResult DeleteWorldLink([FromRoute(Name = "worldLinkUUID")][Required] Guid worldLinkUUID)
{ {
DeleteResult answer = _worldLinkService.Remove((worldLinkUUID)); DeleteResult answer = _worldLinkService.Remove((worldLinkUUID));
...@@ -113,9 +121,10 @@ namespace Org.OpenAPITools.Controllers ...@@ -113,9 +121,10 @@ namespace Org.OpenAPITools.Controllers
/// <summary> /// <summary>
/// Find a link by its UUID. /// Find a World Link by its UUID.
/// </summary> /// </summary>
/// <param name="worldLinkUUID">UUID of the link to retrieve.</param> /// <remarks>Get a single World Link stored in the world storage from its ID.</remarks>
/// <param name="worldLinkUUID">UUID of the World Link to retrieve.</param>
/// <response code="200">Successful operation.</response> /// <response code="200">Successful operation.</response>
/// <response code="400">Invalid UUID supplied.</response> /// <response code="400">Invalid UUID supplied.</response>
/// <response code="404">Not found, could not find UUID in database.</response> /// <response code="404">Not found, could not find UUID in database.</response>
...@@ -124,6 +133,8 @@ namespace Org.OpenAPITools.Controllers ...@@ -124,6 +133,8 @@ namespace Org.OpenAPITools.Controllers
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetWorldLinkById")] [SwaggerOperation("GetWorldLinkById")]
[SwaggerResponse(statusCode: 200, type: typeof(WorldLink), description: "Successful operation.")] [SwaggerResponse(statusCode: 200, type: typeof(WorldLink), description: "Successful operation.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Invalid UUID supplied.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
public override IActionResult GetWorldLinkById([FromRoute(Name = "worldLinkUUID")][Required] Guid worldLinkUUID) public override IActionResult GetWorldLinkById([FromRoute(Name = "worldLinkUUID")][Required] Guid worldLinkUUID)
{ {
WorldLink myworldlink = _worldLinkService.Get(worldLinkUUID); WorldLink myworldlink = _worldLinkService.Get(worldLinkUUID);
...@@ -168,16 +179,18 @@ namespace Org.OpenAPITools.Controllers ...@@ -168,16 +179,18 @@ namespace Org.OpenAPITools.Controllers
} }
/// <summary> /// <summary>
/// Returns the list of all links defined by the world storage. /// Return all World Links.
/// </summary> /// </summary>
/// <response code="200">OK returns all the worldLinks defined by the world storage.</response> /// <remarks>Get all the World Links currently being stored in the world storage.</remarks>
/// <response code="201">Null response</response> /// <response code="200">OK return all the World Links defined by the world storage.</response>
/// <response code="201">Null response.</response>
/// <response code="0">Unexpected error.</response> /// <response code="0">Unexpected error.</response>
[HttpGet] [HttpGet]
[Route("/worldLinks")] [Route("/worldLinks")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("GetWorldLinks")] [SwaggerOperation("GetWorldLinks")]
[SwaggerResponse(statusCode: 200, type: typeof(List<WorldLink>), description: "OK returns all the worldLinks defined by the world storage.")] [SwaggerResponse(statusCode: 200, type: typeof(List<WorldLink>), description: "OK return all the World Links defined by the world storage.")]
[SwaggerResponse(statusCode: 201, type: typeof(string), description: "Null response.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult GetWorldLinks() public override IActionResult GetWorldLinks()
{ {
...@@ -238,6 +251,9 @@ namespace Org.OpenAPITools.Controllers ...@@ -238,6 +251,9 @@ namespace Org.OpenAPITools.Controllers
[Consumes("application/json")] [Consumes("application/json")]
[ValidateModelState] [ValidateModelState]
[SwaggerOperation("ModifyWorldLink")] [SwaggerOperation("ModifyWorldLink")]
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "OK, return the UUID of the modified World Link.")]
[SwaggerResponse(statusCode: 400, type: typeof(string), description: "Bad request.")]
[SwaggerResponse(statusCode: 404, type: typeof(string), description: "Not found, could not find UUID in database.")]
[SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")] [SwaggerResponse(statusCode: 0, type: typeof(Error), description: "Unexpected error.")]
public override IActionResult ModifyWorldLink([FromBody] WorldLink worldLink) public override IActionResult ModifyWorldLink([FromBody] WorldLink worldLink)
{ {
...@@ -248,7 +264,7 @@ namespace Org.OpenAPITools.Controllers ...@@ -248,7 +264,7 @@ namespace Org.OpenAPITools.Controllers
} }
else else
{ {
return StatusCode(200, worldLink.UUID); return StatusCode(200, worldLink.UUID.ToString());
} }
} }
} }
......