Browse Source

API docs improved.

pull/65/head
Sebastian Stehle 9 years ago
parent
commit
a14c3ebcd4
  1. 11
      src/Squidex/Controllers/Api/Apps/AppLanguagesController.cs
  2. 22
      src/Squidex/Controllers/Api/Assets/AssetsController.cs
  3. 12
      src/Squidex/Controllers/Api/Schemas/SchemasController.cs
  4. 10
      src/Squidex/Controllers/Api/Webhooks/WebhooksController.cs

11
src/Squidex/Controllers/Api/Apps/AppLanguagesController.cs

@ -93,20 +93,20 @@ namespace Squidex.Controllers.Api.Apps
/// Updates an app language.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="language">The language to delete from the app.</param>
/// <param name="model">The language properties.</param>
/// <param name="language">The language to update.</param>
/// <param name="request">The language object.</param>
/// <returns>
/// 204 => Language updated.
/// 400 => Language is an invalid language.
/// 400 => Language object is invalid.
/// 404 => App not found.
/// </returns>
[MustBeAppOwner]
[HttpPut]
[Route("apps/{app}/languages/{language}")]
[ApiCosts(1)]
public async Task<IActionResult> Update(string app, string language, [FromBody] UpdateAppLanguageDto model)
public async Task<IActionResult> Update(string app, string language, [FromBody] UpdateAppLanguageDto request)
{
await CommandBus.PublishAsync(SimpleMapper.Map(model, new UpdateLanguage { Language = language }));
await CommandBus.PublishAsync(SimpleMapper.Map(request, new UpdateLanguage { Language = language }));
return NoContent();
}
@ -118,7 +118,6 @@ namespace Squidex.Controllers.Api.Apps
/// <param name="language">The language to delete from the app.</param>
/// <returns>
/// 204 => Language deleted.
/// 400 => Language is an invalid language.
/// 404 => App not found.
/// </returns>
[MustBeAppOwner]

22
src/Squidex/Controllers/Api/Assets/AssetsController.cs

@ -58,16 +58,19 @@ namespace Squidex.Controllers.Api.Assets
/// <summary>
/// Get assets.
/// </summary>
/// <param name="app">The app where the assets belong to.</param>
/// <param name="app">The name of the app.</param>
/// <param name="ids">The optional asset ids.</param>
/// <param name="skip">The number of assets to skip.</param>
/// <param name="take">The number of assets to take.</param>
/// <param name="take">The number of assets to take (Default: 20).</param>
/// <param name="query">The query to limit the files by name.</param>
/// <param name="mimeTypes">Comma separated list of mime types to get.</param>
/// <returns>
/// 200 => Assets returned.
/// 404 => App not found.
/// </returns>
/// <remarks>
/// Get all assets for the app. Mime types can be comma-separated, e.g. application/json,text/html.
/// </remarks>
[HttpGet]
[Route("apps/{app}/assets/")]
[ProducesResponseType(typeof(AssetsDto), 200)]
@ -112,10 +115,10 @@ namespace Squidex.Controllers.Api.Assets
}
/// <summary>
/// Get a asset by id.
/// Get an asset by id.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="id">The id of the asset to retrieve.</param>
/// <param name="app">The name of the app to get the asset from.</param>
/// <returns>
/// 200 => Asset found.
/// 404 => Asset or app not found.
@ -143,13 +146,16 @@ namespace Squidex.Controllers.Api.Assets
/// <summary>
/// Upload a new asset.
/// </summary>
/// <param name="app">The app where the asset is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="file">The file to upload.</param>
/// <returns>
/// 201 => Asset created.
/// 404 => App not found.
/// 400 => Asset exceeds the maximum size.
/// </returns>
/// <remarks>
/// You can only upload one file at a time. The mime type of the file is not calculated by Squidex and must be defined correctly.
/// </remarks>
[HttpPost]
[Route("apps/{app}/assets/")]
[ProducesResponseType(typeof(AssetCreatedDto), 201)]
@ -170,7 +176,7 @@ namespace Squidex.Controllers.Api.Assets
/// <summary>
/// Replace asset content.
/// </summary>
/// <param name="app">The app where the asset is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="id">The id of the asset.</param>
/// <param name="file">The file to upload.</param>
/// <returns>
@ -199,7 +205,7 @@ namespace Squidex.Controllers.Api.Assets
/// <summary>
/// Updates the asset.
/// </summary>
/// <param name="app">The app where the asset is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="id">The id of the asset.</param>
/// <param name="request">The asset object that needs to updated.</param>
/// <returns>
@ -223,7 +229,7 @@ namespace Squidex.Controllers.Api.Assets
/// <summary>
/// Delete an asset.
/// </summary>
/// <param name="app">The app where the schema is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="id">The id of the asset to delete.</param>
/// <returns>
/// 204 => Asset has been deleted.

12
src/Squidex/Controllers/Api/Schemas/SchemasController.cs

@ -63,8 +63,8 @@ namespace Squidex.Controllers.Api.Schemas
/// <summary>
/// Get a schema by name.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema to retrieve.</param>
/// <param name="app">The name of the app to get the schema from.</param>
/// <returns>
/// 200 => Schema found.
/// 404 => Schema or app not found.
@ -93,8 +93,8 @@ namespace Squidex.Controllers.Api.Schemas
/// <summary>
/// Create a new schema.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <param name="request">The schema object that needs to be added to the app.</param>
/// <param name="app">The name of the app to create the schema to.</param>
/// <returns>
/// 201 => Schema created.
/// 400 => Schema name or properties are not valid.
@ -119,7 +119,7 @@ namespace Squidex.Controllers.Api.Schemas
/// <summary>
/// Update a schema.
/// </summary>
/// <param name="app">The app where the schema is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema.</param>
/// <param name="request">The schema object that needs to updated.</param>
/// <returns>
@ -143,7 +143,7 @@ namespace Squidex.Controllers.Api.Schemas
/// <summary>
/// Publish a schema.
/// </summary>
/// <param name="app">The app where the schema is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema to publish.</param>
/// <returns>
/// 204 => Schema has been published.
@ -165,7 +165,7 @@ namespace Squidex.Controllers.Api.Schemas
/// <summary>
/// Unpublish a schema.
/// </summary>
/// <param name="app">The app where the schema is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema to unpublish.</param>
/// <returns>
/// 204 => Schema has been unpublished.
@ -187,7 +187,7 @@ namespace Squidex.Controllers.Api.Schemas
/// <summary>
/// Delete a schema.
/// </summary>
/// <param name="app">The app where the schema is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema to delete.</param>
/// <returns>
/// 204 => Schema has been deleted.

10
src/Squidex/Controllers/Api/Webhooks/WebhooksController.cs

@ -41,9 +41,9 @@ namespace Squidex.Controllers.Api.Webhooks
/// <summary>
/// Get webhooks.
/// </summary>
/// <param name="app">The name of the app to get the schema for.</param>
/// <param name="app">The name of the app.</param>
/// <returns>
/// 200 => Schemas returned.
/// 200 => Webhooks returned.
/// 404 => App not found.
/// </returns>
[HttpGet]
@ -64,9 +64,9 @@ namespace Squidex.Controllers.Api.Webhooks
/// <summary>
/// Create a new webhook.
/// </summary>
/// <param name="request">The webhook object that needs to be added to the app.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema.</param>
/// <param name="app">The name of the app to create the webhook for.</param>
/// <param name="request">The webhook object that needs to be added to the app.</param>
/// <returns>
/// 201 => Webhook created.
/// 400 => Webhook name or properties are not valid.
@ -94,7 +94,7 @@ namespace Squidex.Controllers.Api.Webhooks
/// <summary>
/// Delete a webhook.
/// </summary>
/// <param name="app">The app where the webhook is a part of.</param>
/// <param name="app">The name of the app.</param>
/// <param name="name">The name of the schema.</param>
/// <param name="id">The id of the webhook to delete.</param>
/// <returns>

Loading…
Cancel
Save