fix: openapi v3 use string

This commit is contained in:
loks0n
2024-09-26 12:59:41 +01:00
parent 4eb971d3b6
commit 6c2e407ffb
17 changed files with 31 additions and 96 deletions
+2 -5
View File
@@ -9403,12 +9403,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "string",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"$ref": "#\/components\/schemas\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
@@ -35587,12 +35587,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "string",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"$ref": "#\/components\/schemas\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
+2 -5
View File
@@ -25964,12 +25964,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "string",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"$ref": "#\/components\/schemas\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
@@ -9403,12 +9403,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "string",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"$ref": "#\/components\/schemas\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
@@ -35587,12 +35587,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "string",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"$ref": "#\/components\/schemas\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
@@ -25964,12 +25964,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "string",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"$ref": "#\/components\/schemas\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
+2 -6
View File
@@ -9589,13 +9589,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "payload",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"type": "object",
"$ref": "#\/definitions\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
+2 -6
View File
@@ -36104,13 +36104,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "payload",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"type": "object",
"$ref": "#\/definitions\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
+2 -6
View File
@@ -26458,13 +26458,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "payload",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"type": "object",
"$ref": "#\/definitions\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
+2 -6
View File
@@ -9589,13 +9589,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "payload",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"type": "object",
"$ref": "#\/definitions\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
@@ -36104,13 +36104,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "payload",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"type": "object",
"$ref": "#\/definitions\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
+2 -6
View File
@@ -26458,13 +26458,9 @@
"format": "int32"
},
"responseBody": {
"type": "object",
"type": "payload",
"description": "HTTP response body. This will return empty unless execution is created as synchronous.",
"x-example": "",
"items": {
"type": "object",
"$ref": "#\/definitions\/payload"
}
"x-example": ""
},
"responseHeaders": {
"type": "array",
@@ -549,6 +549,7 @@ class OpenAPI3 extends Format
switch ($rule['type']) {
case 'string':
case 'datetime':
case 'payload':
$type = 'string';
break;
@@ -585,6 +585,10 @@ class Swagger2 extends Format
$type = 'boolean';
break;
case 'payload':
$type = 'payload';
break;
default:
$type = 'object';
$rule['type'] = ($rule['type']) ?: 'none';
+1
View File
@@ -14,6 +14,7 @@ abstract class Model
public const TYPE_DATETIME = 'datetime';
public const TYPE_DATETIME_EXAMPLE = '2020-10-15T06:38:00.000+00:00';
public const TYPE_RELATIONSHIP = 'relationship';
public const TYPE_PAYLOAD = 'payload';
/**
* @var bool
@@ -81,7 +81,7 @@ class Execution extends Model
'example' => 200,
])
->addRule('responseBody', [
'type' => Response::MODEL_PAYLOAD,
'type' => self::TYPE_PAYLOAD,
'description' => 'HTTP response body. This will return empty unless execution is created as synchronous.',
'default' => '',
])
@@ -1,29 +0,0 @@
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Payload extends Model
{
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'Payload';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_PAYLOAD;
}
}