Arjix
Arjix
Explore posts from servers
HHono
Created by reko on 5/14/2025 in #help
How to wait for streamSse to finish?
just a small project I can play around in
13 replies
HHono
Created by reko on 5/14/2025 in #help
How to wait for streamSse to finish?
yeah I didn't mean to only return the stream once resolved
13 replies
HHono
Created by reko on 5/14/2025 in #help
How to wait for streamSse to finish?
that way I can give an example of what I meant
13 replies
HHono
Created by reko on 5/14/2025 in #help
How to wait for streamSse to finish?
can you write a small repro? nothing much, just the middleware, and the Hono route using streamSSE
13 replies
HHono
Created by reko on 5/14/2025 in #help
How to wait for streamSse to finish?
you could probably use a promise that resolves when the stream is done
13 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
They have multiple routes that return a similar response, the difference being if videos exist or not
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
The issue is that it doesn't return a union
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
For payloads? sure For responses? nope
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
Oh you meant zod discrimination
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
Like
const schemas = {
base: MyZodSchema,
withVideos: MyZodSchema.extend(...)
} as const;

responses: {
200: jsonStuff(schemas.withVideos)
}
const schemas = {
base: MyZodSchema,
withVideos: MyZodSchema.extend(...)
} as const;

responses: {
200: jsonStuff(schemas.withVideos)
}
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
Idk man, I am here to solve problems 🤣
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
In this case they are
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
Notice that the overloads are merely types and not implementations, since JavaScript has polymorphism they did it that way
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
See online how typescript function overloads work, ChatGPT can help you with it as well
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
Right now your function returns a union of those two types (?), you'll have to narrow it down
21 replies
HHono
Created by Mike on 5/13/2025 in #help
Why isn't my dynamically extended Zod schema enforcing types in @hono/zod-openapi?
You can add two overloads to the function to fix this issue, when the videos is false, to return a specific type, when it is true, to return another type
21 replies
HHono
Created by Mike on 5/11/2025 in #help
@hono/zod-openapi generates :param instead of {param} — breaks openapi-fetch compatibility
it does
16 replies
HHono
Created by Mike on 5/11/2025 in #help
@hono/zod-openapi generates :param instead of {param} — breaks openapi-fetch compatibility
that's ass
16 replies
HHono
Created by Mike on 5/11/2025 in #help
@hono/zod-openapi generates :param instead of {param} — breaks openapi-fetch compatibility
it leaves it as-is
16 replies