Fix specs and sdk generation

This commit is contained in:
Matej Bačo
2025-06-09 13:47:38 +02:00
parent 11f31a15b6
commit d6bcb46b36
3 changed files with 63 additions and 3 deletions
+22 -1
View File
@@ -25446,12 +25446,33 @@
"Temporary Redirect 307",
"Permanent Redirect 308"
]
},
"resourceId": {
"type": "string",
"description": "ID of parent resource.",
"x-example": "<RESOURCE_ID>"
},
"resourceType": {
"type": "string",
"description": "Type of parent resource.",
"x-example": "site",
"enum": [
"site",
"function"
],
"x-enum-name": "ProxyResourceType",
"x-enum-keys": [
"Site",
"Function"
]
}
},
"required": [
"domain",
"url",
"statusCode"
"statusCode",
"resourceId",
"resourceType"
]
}
}
+24 -1
View File
@@ -25696,12 +25696,35 @@
"Temporary Redirect 307",
"Permanent Redirect 308"
]
},
"resourceId": {
"type": "string",
"description": "ID of parent resource.",
"default": null,
"x-example": "<RESOURCE_ID>"
},
"resourceType": {
"type": "string",
"description": "Type of parent resource.",
"default": null,
"x-example": "site",
"enum": [
"site",
"function"
],
"x-enum-name": "ProxyResourceType",
"x-enum-keys": [
"Site",
"Function"
]
}
},
"required": [
"domain",
"url",
"statusCode"
"statusCode",
"resourceId",
"resourceType"
]
}
}
+17 -1
View File
@@ -113,6 +113,16 @@ abstract class Format
protected function getEnumName(string $service, string $method, string $param): ?string
{
switch ($service) {
case 'proxy':
switch ($method) {
case 'createRedirectRule':
switch ($param) {
case 'resourceType':
return 'ProxyResourceType';
}
break;
}
break;
case 'console':
switch ($method) {
case 'getResource':
@@ -441,7 +451,13 @@ abstract class Format
case 'proxy':
switch ($method) {
case 'createRedirectRule':
return ['Moved Permanently 301', 'Found 302', 'Temporary Redirect 307', 'Permanent Redirect 308'];
switch ($param) {
case 'statusCode':
return ['Moved Permanently 301', 'Found 302', 'Temporary Redirect 307', 'Permanent Redirect 308'];
case 'resourceType':
return ['Site', 'Function'];
}
break;
}
break;
case 'functions':