You are here

protected function JsonApiGenerator::filterParameters in OpenAPI for JSON:API 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php \Drupal\openapi_jsonapi\Plugin\openapi\OpenApiGenerator\JsonApiGenerator::filterParameters()

Filters an associative array by key on a set of parameter.

Parameters

array $parameters: Associative array that is going to be filtered.

Return value

array Returns the filtered associative array.

1 call to JsonApiGenerator::filterParameters()
JsonApiGenerator::getMethodParameters in src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
Get the parameters array for a method on a route.

File

src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php, line 942

Class

JsonApiGenerator
Defines an OpenApi Schema Generator for the JsonApi module.

Namespace

Drupal\openapi_jsonapi\Plugin\openapi\OpenApiGenerator

Code

protected function filterParameters(array $parameters) {
  foreach (static::$PARAMETERS_FILTER_LIST as $filter) {
    if (array_key_exists($filter, $parameters)) {
      unset($parameters[$filter]);
    }
  }
  return $parameters;
}