nextlove icon indicating copy to clipboard operation
nextlove copied to clipboard

An NPM module that has best practices and essential modules for building APIs with NextJS

Results 36 nextlove issues
Sort by recently updated
recently updated
newest added

E.x. `nextlove generate-route-schemas` should output ```ts import {z} from "zod" const routes = { "/hello/world": { queryParams: z.object({device_id: z.string()}) jsonResponse: z.object({message: z.string()}) } } ```

Itd be nice to see what this produced via a test but looks okay to start! _Originally posted by @seveibar in https://github.com/seamapi/nextlove/pull/72#pullrequestreview-1434574424_

Close #60 Checks if json response is a zod json object schema or not by checking the zod schema definition typeName. It's a bit of a weird feature that I...

```typescript withRouteSpec({ methods: ["GET"], jsonResponse: z.array(z.number()) } as const) ``` doesn't work: ![Screenshot 2023-04-06 at 4 42 26 PM](https://user-images.githubusercontent.com/7410405/230513035-5a80a0d6-ccfd-4ebb-a4be-72ee1fb45898.png)

good first issue

`jsonResponse` type checking should be applied when `.status` is omitted since it defaults to 200: https://user-images.githubusercontent.com/7410405/230510123-1fa03cfc-54fc-414e-a059-6085baa87bad.mov

good first issue

New Vercel App endpoints don't support `res` Could this also help with method-discriminated validation more generally? ```ts export const GET = withRouteSpec.get({ queryParams: z.object({ }) } as const, async (req)...