Skip to content

Conversation

@Hugo-Persson
Copy link

Added support for generating schema for headers and validating headers. Headers can be added to specification like this

		.input({
			headers: z.object({
				"authentication-token": z.string(),
				"x-device-type": z.nativeEnum(DeviceType),
			}),
		})

They are then passed in handler like this:

		.handler(async (_, { headers }) => {

The headers type is automatically inferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant