GET api querystring schema validation for boolean is failing.
- Dominant language
- No language data
- Stars
- 68
- Forks
- 8
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 2
Description
#### What are you trying to achieve, or the steps to reproduce?
I am getting error in GET api for boolean schema validation if I pass 0 or 1 as query parameters, it should not throw an error for 0 / 1 querystring parameters, same is working in POST request if we pass 0 / 1 or true / false but GET is failing in schema
```js
let promoSchema = {
querystring: {
type: 'object',
required: ['buynow'],
properties: {
buynow: {
type: 'boolean',
default: 0,
nullable: true
}
}
},
params: {},
response: {}
}
```
#### What was the result you received?
{
"statusCode": 400,
"error": "Bad Request",
"message": "querystring/buynow must be boolean"
}
#### What did you expect?
When I pass a boolean parameter as 0 or 1 I get above error in GET API calls, but in POST api calls its working fine for 0/1 or true/false both, same is working fine if we send true / false in GET parameters. 0 or 1 is also boolean it should work.
#### Context
* *node version*: v16.13.1
* *fastify version*: >=4.2.0
* *os*: Windows
* *any other relevant information*:
Contributor guide
Assessment
This issue has not been assessed yet.