-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
🐛 Bug Report
When defining a route, it's easier to schema.query be automatically copied into schema.querystring, mainly because request.query is what we use to access the querystring, and simmetry here would be good.
Moreover, we should look into doing some stricter validation of those properties to catch this type of errors.
To Reproduce
app.get('/', {
schema: {
query: { // this should querystring
type: "object",
properties: {
name: {
type: "string",
default: "world"
}
},
required: ["name"]
}
}
}, async (request, reply) => {
return { hello: request.query.name }
})Expected behavior
schema.query to work as schema.querystring.
Your Environment
- node version: 10
- fastify version: all
- os: Mac, Windows, Linux
Ethan-Arrowood and Eomm
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers