Skip to content

Conversation

swikars1
Copy link
Contributor

The Elysia schema api is described wrong.

The Elysia schema api is described wrong.
@SaltyAom
Copy link
Member

SaltyAom commented Jan 4, 2024

I'm confused, the Elysia.schema usage is correct?
Maybe you're referring to .guard instead of .beforeHandle?

@swikars1
Copy link
Contributor Author

swikars1 commented Jan 4, 2024

I'm confused, the Elysia.schema usage is correct? Maybe you're referring to .guard instead of .beforeHandle?

the usage as shown in the docs is incorrect it seems.


```typescript
import { Elysia } from 'elysia'

new Elysia()
.get('/none', () => 'hi')
.schema({ // [!code ++]
.onBeforeHandle({ // [!code ++]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as maintainer suggested, this should be .guard({

@bogeychan bogeychan removed their assignment May 23, 2024
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.

4 participants