Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document arrays of GenericParameters with XmlComments and support Overload methods #2982

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,13 @@
}
}
},
"/{tennantId}/orders/Delete/{id}": {
"/{tennantId}/orders/DeleteById": {
jgarciadelanoceda marked this conversation as resolved.
Show resolved Hide resolved
"delete": {
"tags": [
"Orders"
],
"summary": "Delete by Id",
"parameters": [
{
"name": "Id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "tennantId",
"in": "path",
Expand All @@ -158,6 +149,27 @@
}
}
],
"requestBody": {
"description": "deleting Id",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Deleted",
Expand Down Expand Up @@ -195,18 +207,6 @@
],
"summary": "Delete by Id List",
"parameters": [
{
"name": "id",
"in": "path",
"description": "deleting Id",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
},
{
"name": "tennantId",
"in": "path",
Expand All @@ -216,6 +216,36 @@
}
}
],
"requestBody": {
"description": "deleting Ids",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
},
"application/*+json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Deleted",
Expand Down Expand Up @@ -374,22 +404,13 @@
}
}
},
"/{tennantId}/products/Delete/{id}": {
"/{tennantId}/products/DeleteById": {
"delete": {
"tags": [
"Products"
],
"summary": "Delete by Id",
"parameters": [
{
"name": "Id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"name": "tennantId",
"in": "path",
Expand All @@ -399,6 +420,27 @@
}
}
],
"requestBody": {
"description": "deleting Id",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Product"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Deleted",
Expand Down Expand Up @@ -436,18 +478,6 @@
],
"summary": "Delete by Id List",
"parameters": [
{
"name": "id",
"in": "path",
"description": "deleting Id",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
},
{
"name": "tennantId",
"in": "path",
Expand All @@ -457,6 +487,36 @@
}
}
],
"requestBody": {
"description": "deleting Ids",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
},
"application/*+json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Deleted",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,36 @@ public int Create([FromBody, Required] TResource resource, CancellationToken can
/// <returns></returns>
/// <response code="200">Deleted</response>
/// <response code="404">Failed</response>
[HttpDelete($"{nameof(Delete)}/{{{nameof(id)}}}")]
public virtual int Delete([Required, FromRoute] TResource id, CancellationToken cancellationToken)
[HttpDelete($"{nameof(Delete)}ById")]
public virtual int Delete([Required, FromBody] TResource id, CancellationToken cancellationToken)
{
return 1;
}

/// <summary>
/// Delete by Id List
/// </summary>
/// <param name="id">deleting Id</param>
/// <param name="ids">deleting Ids</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <response code="200">Deleted</response>
/// <response code="404">Failed</response>
[HttpDelete($"{nameof(Delete)}/List")]
public virtual int Delete([Required, FromRoute] List<TResource> id, CancellationToken cancellationToken)
public virtual int Delete([Required, FromBody] List<TResource> ids, CancellationToken cancellationToken)
{
return 1;
}

/// <summary>
/// Delete by Ids
/// </summary>
/// <param name="ids">deleting Ids</param>
/// <param name="resources">deleting Ids</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <response code="200">Deleted</response>
/// <response code="404">Failed</response>
[HttpDelete("")]
public virtual int Delete([Required, FromBody] TResource[] ids, CancellationToken cancellationToken)
public virtual int Delete([Required, FromBody] TResource[] resources, CancellationToken cancellationToken)
{
return 1;
}
Expand Down