Skip to content

Commit 070ee30

Browse files
fix: support both query and querystring validation
1 parent f94be34 commit 070ee30

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ export { default as schema } from './${parsedPath.base}'
2727
export interface ${prefix}Reply extends FastifyReply<ServerResponse | Http2ServerResponse> {}
2828
2929
${await compile(schema.params || defaultSchema, prefix + "Params", opts)}
30-
${await compile(schema.querystring || defaultSchema, prefix + "Query", opts)}
30+
${await compile(
31+
schema.querystring || schema.query || defaultSchema,
32+
prefix + "Query",
33+
opts
34+
)}
3135
${await compile(schema.body || defaultSchema, prefix + "Body", opts)}
3236
${await compile(schema.headers || defaultSchema, prefix + "Headers", opts)}
3337
3438
export interface ${prefix}Request extends FastifyRequest {
3539
params: ${prefix}Params,
36-
querystring: ${prefix}Query,
40+
query: ${prefix}Query,
3741
body: ${prefix}Body,
3842
headers: ${prefix}Headers,
3943
}

0 commit comments

Comments
 (0)