Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference models not resolved in schema path #169

Open
a-float opened this issue Nov 12, 2024 · 1 comment
Open

Reference models not resolved in schema path #169

a-float opened this issue Nov 12, 2024 · 1 comment

Comments

@a-float
Copy link

a-float commented Nov 12, 2024

Validation models defined using the model method are not resolved in registerSchemaPath

Issue

Using the .model chain method

 app
 .model({
    signIn: t.Object({
      username: t.String(),
      password: t.String(),
    }),
  })
  .post("/signin", () => "hello", {body: "signIn"})

results in the spec request body being empty.
Using the schema directly:

 app.post("/signin", () => "hello", 
 {
   body:  t.Object({
      username: t.String(),
      password: t.String(),
   })
})

makes the spec contain the specified fields.

Using .model Using the schema directly

Expected

The generated spec should be the same regardless of the schema definition method.

Dependencies

├── @elysiajs/[email protected]
├── @elysiajs/[email protected]
├── [email protected]
├── [email protected]
@a-float
Copy link
Author

a-float commented Nov 12, 2024

A duplicate of #155 (comment)

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

No branches or pull requests

1 participant