Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Sep 16, 2024
1 parent 5f65071 commit 1327cbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Laravel/workbench/app/Models/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use ApiPlatform\Metadata\QueryParameter;
use ApiPlatform\OpenApi\Model\Parameter;
use ApiPlatform\Serializer\Filter\PropertyFilter;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
Expand All @@ -47,9 +46,9 @@
new GetCollection(),
]
)]
#[QueryParameter(key: 'isbn', schema: ['minimum' => '9783877138395', 'maximum' => '9793877138395'], filter: PartialSearchFilter::class)]
#[QueryParameter(key: 'name', schema: ['pattern' => '/^a/'], filter: PartialSearchFilter::class)]
#[QueryParameter(key: 'author', openApi: new Parameter(name: 'author', in: 'query', allowEmptyValue: false), filter: EqualsFilter::class, required: true)]
#[QueryParameter(key: 'isbn', filter: PartialSearchFilter::class, constraints: 'min:2')]
#[QueryParameter(key: 'name', filter: PartialSearchFilter::class)]
#[QueryParameter(key: 'author', filter: EqualsFilter::class)]
#[QueryParameter(key: 'publicationDate', filter: DateFilter::class, property: 'publication_date')]
#[QueryParameter(key: 'publicationDateWithNulls', filter: DateFilter::class, property: 'publication_date', filterContext: ['include_nulls' => true])]
#[QueryParameter(key: 'isbn_range', filter: RangeFilter::class, property: 'isbn')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
uriTemplate: 'search_filter_parameter{._format}',
parameters: [
'foo' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter'),
'fooAlias' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter', property: 'foo'),
'order[:property]' => new QueryParameter(filter: 'app_odm_search_filter_via_parameter.order_filter'),

'searchPartial[:property]' => new QueryParameter(filter: 'app_odm_search_filter_partial'),
Expand Down

0 comments on commit 1327cbf

Please sign in to comment.