HonoH
Hono2y ago
Korny

Case insensitive query params

We are using hono-zod-openapi to replace an existing API.
Sadly the old API (written in ASP.Net) appears to have case-insensitive handling of parameters - and we may need to emulate this. Gah.

So we have something like
const myParams = z.object({
  FooBar: z.string().openapi({...})
});
const route = createRoute({
method: 'get',
path: '/blah',
request:{
  query: myParams,


But I need to support GET /blah?fooBar= and all other variants of FooBar and foobar etc.

Any ideas? I guess worst case we could add some middleware to downcase all parameters or something.
Was this page helpful?