More work on the api and documentation #222 #205

This commit is contained in:
tidusjar 2016-05-19 14:29:41 +01:00
parent 9b4ae2c486
commit 187a59261a
7 changed files with 186 additions and 19 deletions

View file

@ -42,11 +42,23 @@ namespace PlexRequests.UI.Modules
with.ResourcePath("/requests");
with.Summary("The list of requests");
with.Notes("This returns a list of users from our awesome app");
with.Notes("This returns a list of requests");
with.QueryParam<string>("apikey", "The Api Key found in the settings", true);
with.Model<ApiModel<List<RequestedModel>>>();
});
Describe["GetRequest"] = description => description.AsSwagger(with =>
{
with.ResourcePath("/requests/{id}");
with.Summary("Get's a single request");
with.Notes("This returns a single request");
with.QueryParam<string>("apikey", "The Api Key found in the settings", true);
//with.QueryParam<int>("id", "The request id to return", true);
with.PathParam<int>("id");
with.Model<ApiModel<List<RequestedModel>>>();
});
Describe["PostRequests"] = description => description.AsSwagger(with =>
{
with.ResourcePath("/requests");
@ -72,7 +84,7 @@ namespace PlexRequests.UI.Modules
with.ResourcePath("/requests");
with.Summary("Deletes an existing request");
with.Model<ApiModel<bool>>();
with.BodyParam<RequestedModel>("The request", true);
with.BodyParam<int>("The request ID to delete", true);
with.QueryParam<string>("apikey", "The Api Key found in the settings", true);
with.Notes("Deletes an existing request. If the request doesn't exist we will return an error.");
});