Skip to content

Commit

Permalink
fix: param altnames and headers conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
iann838 committed Oct 14, 2024
1 parent 97a096b commit 0eff031
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ export class Route<R, Ps extends RouteParameters, E = unknown> {
else if (parameter.location == "body")
bodyParameter = parameter as BodyParameter<z.ZodType>
else if (parameter.location == "header")
paramSchemas[parameter.location][parameter.options.altName ?? name.replace(/_/g, "-")] = parameter.schema!
paramSchemas[parameter.location][
parameter.options.altName ?? name.replace(/_/g, "-")
] = parameter.schema!
else
paramSchemas[parameter.location][parameter.options.altName ?? name] = parameter.schema!
paramSchemas[parameter.location][parameter.options.altName ?? name] =
parameter.schema!
}
let body: ZodRequestBody | undefined = undefined
if (bodyParameter) {
Expand Down

0 comments on commit 0eff031

Please sign in to comment.