isCustom fix

This commit is contained in:
Yuri Kuznetsov
2025-12-03 00:03:35 +02:00
parent b2c7eef31a
commit f492bfc374
+19 -10
View File
@@ -268,7 +268,7 @@ class Provider
{
$pathItemRoot = (object) [];
$pathItemRoot->post = $this->prepareOperationCreate($entityType);
$pathItemRoot->get = $this->prepareOperationList($entityType);
$pathItemRoot->get = $this->prepareOperationList($params, $entityType);
$pathItemRecord = (object) [
'parameters' => [
@@ -556,7 +556,7 @@ class Provider
/**
* @return array<string, mixed>
*/
private function prepareOperationList(string $entityType): array
private function prepareOperationList(Params $params, string $entityType): array
{
$parameters = [];
@@ -574,7 +574,7 @@ class Provider
'description' => 'Disable calculation of the total number of records.',
];
$parameters = array_merge($parameters, $this->prepareSearchParameters($entityType));
$parameters = array_merge($parameters, $this->prepareSearchParameters($params, $entityType));
return [
'tags' => [$entityType],
@@ -588,7 +588,7 @@ class Provider
/**
* @return string[]
*/
private function getSelectAttributeList(string $entityType): array
private function getSelectAttributeList(Params $params, string $entityType): array
{
$fieldDefsList = $this->defs->getEntity($entityType)->getFieldList();
@@ -604,6 +604,10 @@ class Provider
continue;
}
if ($params->skipCustom && $fieldDefs->getParam('isCustom')) {
continue;
}
$output = array_merge(
$output,
$this->fieldUtil->getAttributeList($entityType, $fieldDefs->getName())
@@ -678,7 +682,7 @@ class Provider
/**
* @return array<string, mixed>[]
*/
private function prepareSearchParameters(string $entityType): array
private function prepareSearchParameters(Params $params, string $entityType): array
{
$parameters = [
[
@@ -772,7 +776,7 @@ class Provider
];
}
$selectAttributeList = $this->getSelectAttributeList($entityType);
$selectAttributeList = $this->getSelectAttributeList($params, $entityType);
if ($selectAttributeList) {
$parameters[] = [
@@ -932,7 +936,7 @@ class Provider
]
];
$pathItem['get'] = $this->prepareOperationListLink($entityType, $link, $foreignEntityType);
$pathItem['get'] = $this->prepareOperationListLink($params, $entityType, $link, $foreignEntityType);
$pathItem['post'] = $this->prepareOperationPostLink($entityType, $link, $foreignEntityType);
$pathItem['delete'] = $this->prepareOperationDeleteLink($entityType, $link, $foreignEntityType);
@@ -942,11 +946,16 @@ class Provider
/**
* @return array<string, mixed>
*/
private function prepareOperationListLink(string $entityType, string $link, string $foreignEntityType): array
{
private function prepareOperationListLink(
Params $params,
string $entityType,
string $link,
string $foreignEntityType,
): array {
$parameters = [];
$parameters = array_merge($parameters, $this->prepareSearchParameters($foreignEntityType));
$parameters = array_merge($parameters, $this->prepareSearchParameters($params, $foreignEntityType));
$operation = [
'tags' => [$entityType],