-
Notifications
You must be signed in to change notification settings - Fork 96
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
default query string options do not work for empty query string #62
Labels
Comments
piotr-s-brainhub
changed the title
default query string options
default query string options do not work for empty query string
Dec 19, 2017
This doesn't work as well:
|
It's because Joi needs to obtain a query object
|
I also faced this issue but in my case, the problem was caused by koa-qs package. Internally it uses descriptors set/get to manage
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OS: Max OS X 10.12.2
Node version: 8.6.0
npm version: 5.2.0
koa version: 2.4.1
koa-joi-router version: 5.0.0
joi version: 9.2.0
I have the following route:
The actual behavior:
when I specify a query string ex.
?search=foo
, I get the correct default value forsort
parameter, however for no query string I getundefined
The expected behavior:
even for no query string, the
sort
parameter should have{ 'name': 1 }
as default valueThe text was updated successfully, but these errors were encountered: