Closed JasCodes closed 10 months ago
From the example, it is difficult to understand where the error is. And why, if the return type is not specified in the schema, should we specify, for example, Object
?
Bescause take swagger code gen from example below
This is not uncommon practive using javascript pattern.
import { Elysia, t } from "elysia";
export const loginController = new Elysia().post( "/login", async ({ body }) => { return { "success": true } }, { body: t.Object({ username: t.String({ error: "Username is required" }), }), }, );
I have choosen not to describe return type. But in most cases will return something.