Skip to content

Commit

Permalink
fix(Text2Image): Fix OpenAPI types
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Oct 20, 2023
1 parent 37c4ccc commit 7b7f552
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/Controller/TextToImageApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function isAvailable(): DataResponse {
* @param string $identifier An arbitrary identifier for the task
* @param int $numberOfImages The number of images to generate
*
* @return DataResponse<Http::STATUS_OK, array{task: CoreTextToImageTask}, array{}>|DataResponse<Http::STATUS_PRECONDITION_FAILED, array{message: string}, array{}>
* @return DataResponse<Http::STATUS_OK, array{task: CoreTextToImageTask}, array{}>|DataResponse<Http::STATUS_PRECONDITION_FAILED|Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
*
* 200: Task scheduled successfully
* 412: Scheduling task is not possible
Expand Down
67 changes: 65 additions & 2 deletions core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"userId",
"appId",
"input",
"identifier"
"identifier",
"numberOfImages"
],
"properties": {
"id": {
Expand All @@ -483,6 +484,10 @@
"identifier": {
"type": "string",
"nullable": true
},
"numberOfImages": {
"type": "integer",
"format": "int64"
}
}
},
Expand Down Expand Up @@ -5280,6 +5285,16 @@
"default": ""
}
},
{
"name": "numberOfImages",
"in": "query",
"description": "The number of images to generate",
"schema": {
"type": "integer",
"format": "int64",
"default": 8
}
},
{
"name": "OCS-APIRequest",
"in": "header",
Expand Down Expand Up @@ -5367,6 +5382,44 @@
}
}
}
},
"500": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
Expand Down Expand Up @@ -5680,7 +5733,7 @@
}
}
},
"/ocs/v2.php/text2image/task/{id}/image": {
"/ocs/v2.php/text2image/task/{id}/image/{index}": {
"get": {
"operationId": "text_to_image_api-get-image",
"summary": "This endpoint allows downloading the resulting image of a task",
Expand All @@ -5707,6 +5760,16 @@
"format": "int64"
}
},
{
"name": "index",
"in": "path",
"description": "The index of the image to retrieve",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "OCS-APIRequest",
"in": "header",
Expand Down

0 comments on commit 7b7f552

Please sign in to comment.