diff --git a/README.md b/README.md index 8ed7de0..7cc3ea8 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,8 @@ ddev exec bin/console api:openapi:export --yaml >> openapi.yaml -> export OpenApi spec + (Achtung: Erst die alte OpenApi.yaml löschen!) + # Lexik JWT - https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/index.html - Nur bei NEU Installation: diff --git a/openapi.yaml b/openapi.yaml index 1af3dc3..046a64b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -420,6 +420,47 @@ paths: style: form explode: false allowReserved: false + - + name: 'order[name]' + in: query + description: '' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: string + enum: + - asc + - desc + style: form + explode: false + allowReserved: false + - + name: type + in: query + description: '' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: string + style: form + explode: false + allowReserved: false + - + name: 'type[]' + in: query + description: '' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: array + items: + type: string + style: form + explode: true + allowReserved: false deprecated: false post: operationId: api_partners_post diff --git a/src/ApiResource/PartnerApi.php b/src/ApiResource/PartnerApi.php index 28f0321..04cb54b 100644 --- a/src/ApiResource/PartnerApi.php +++ b/src/ApiResource/PartnerApi.php @@ -9,6 +9,7 @@ namespace App\ApiResource; use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; +use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Doctrine\Orm\State\Options; use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiProperty; @@ -50,6 +51,7 @@ use Symfony\Component\Validator\Constraints\NotBlank; stateOptions: new Options(entityClass: Partner::class) )] #[ApiFilter(OrderFilter::class, properties: ['name'], arguments: ['orderParameterName' => 'order'])] +#[ApiFilter(SearchFilter::class, properties: ['type' => 'exact'])] class PartnerApi { #[ApiProperty(readable: false, writable: false, identifier: true)]