mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix multi-method graphql parameter mapping
This commit is contained in:
@@ -4555,7 +4555,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
|
||||
@@ -8046,7 +8046,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
|
||||
@@ -7597,7 +7597,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
|
||||
@@ -4555,7 +4555,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
|
||||
@@ -8046,7 +8046,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
|
||||
@@ -7597,7 +7597,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "object"
|
||||
|
||||
@@ -4692,7 +4692,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
|
||||
@@ -8174,7 +8174,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
|
||||
@@ -7713,7 +7713,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
|
||||
@@ -4692,7 +4692,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
|
||||
@@ -8174,7 +8174,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
|
||||
@@ -7713,7 +7713,7 @@
|
||||
},
|
||||
"documents": {
|
||||
"type": "array",
|
||||
"description": "Array of documents data as JSON object.",
|
||||
"description": "Array of documents data as JSON objects.",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
|
||||
@@ -117,13 +117,19 @@ class Mapper
|
||||
$list = false;
|
||||
|
||||
foreach ($route->getParams() as $name => $parameter) {
|
||||
$methodParameters = $method->getParameters();
|
||||
$sdkParameters = $method->getParameters();
|
||||
|
||||
if (!empty($methodParameters)) {
|
||||
if (!array_key_exists($name, $methodParameters)) {
|
||||
if (!empty($sdkParameters)) {
|
||||
$sdkMethodParameters = [];
|
||||
foreach($sdkParameters as $sdkParameter) {
|
||||
$sdkMethodParameters[$sdkParameter->getName()] = $sdkParameter;
|
||||
}
|
||||
|
||||
if (!\array_key_exists($name, $sdkMethodParameters)) {
|
||||
continue;
|
||||
}
|
||||
$optional = $methodParameters[$name]['optional'];
|
||||
|
||||
$optional = $sdkMethodParameters[$name]->getOptional();
|
||||
} else {
|
||||
$optional = $parameter['optional'];
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class Parameter
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
||||
public function isOptional(): bool
|
||||
public function getOptional(): bool
|
||||
{
|
||||
return $this->optional;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ class OpenAPI3 extends Format
|
||||
foreach ($method->getParameters() as $parameter) {
|
||||
$additionalMethod['parameters'][] = $parameter->getName();
|
||||
|
||||
if (!$parameter->isOptional()) {
|
||||
if (!$parameter->getOptional()) {
|
||||
$additionalMethod['required'][] = $parameter->getName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ class Swagger2 extends Format
|
||||
foreach ($method->getParameters() as $parameter) {
|
||||
$additionalMethod['parameters'][] = $parameter->getName();
|
||||
|
||||
if (!$parameter->isOptional()) {
|
||||
if (!$parameter->getOptional()) {
|
||||
$additionalMethod['required'][] = $parameter->getName();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user