8000 fix: null type in optionresolver should be lowercase by BigZ · Pull Request #30 · wizardstechnologies/php-rest-api · GitHub
[go: up one dir, main page]

Skip to content

fix: null type in optionresolver should be lowercase #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/WizardsRest/Parser/RestQueryParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RestQueryParser
/**
* This is an extra filtering parameter, not documented in jsonapi, but really useful to filter api requests.
* It supports operators such as <, >, <=, >=, !=
*/
*/
const PARAMETER_FILTER_OPERATOR = 'filteroperator';

const DEFAULT_PAGE = 1;
Expand Down Expand Up @@ -88,11 +88,11 @@ private function parseRequest(ServerRequestInterface $request)
self::PARAMETER_FILTER_OPERATOR => self::DEFAULT_FILTER_OPERATOR,
]);

$resolver->setAllowedTypes(self::PARAMETER_PAGE, ['NULL', 'string']);
$resolver->setAllowedTypes(self::PARAMETER_LIMIT, ['NULL', 'string']);
$resolver->setAllowedTypes(self::PARAMETER_SORT, ['NULL', 'string']);
$resolver->setAllowedTypes(self::PARAMETER_FILTER, ['NULL', 'array']);
$resolver->setAllowedTypes(self::PARAMETER_FILTER_OPERATOR, ['NULL', 'array']);
$resolver->setAllowedTypes(self::PARAMETER_PAGE, ['null', 'string']);
$resolver->setAllowedTypes(self::PARAMETER_LIMIT, ['null', 'string']);
$resolver->setAllowedTypes(self::PARAMETER_SORT, ['null', 'string']);
$resolver->setAllowedTypes(self::PARAMETER_FILTER, ['null', 'array']);
$resolver->setAllowedTypes(self::PARAMETER_FILTER_OPERATOR, ['null', 'array']);

$queryParams = $request->getQueryParams();

Expand Down
0