elysia icon indicating copy to clipboard operation
elysia copied to clipboard

Drop `schema` method and update the docs

Open skwowet opened this issue 1 year ago • 4 comments

What version of Elysia.JS is running?

latest

What platform is your computer?

MacOS Darwin 23.2.0 x86_64 i386

What steps can reproduce the bug?

code-sample

What is the expected behavior?

The schema method has been renamed to guard sometime ago. So we should remove that method from showing up on Elysia instance and also update the docs here: https://elysiajs.com/essential/schema#global-schema

What do you see instead?

The schema method is still popping up next to guard, even though we've changed its name to guard.

Additional information

Discord thread: https://discord.com/channels/1044804142461362206/1202502724911112242

skwowet avatar Feb 15 '24 11:02 skwowet

Thanks for reporting.

What do you mean by showing up on Elysia instance? schema no longer exists on the object. This is what the typescript error tells you.

In future, please open issues relating to documentation in the elysia documentation repository: https://github.com/elysiajs/documentation

bogeychan avatar Feb 15 '24 13:02 bogeychan

@bogeychan Sorry for the confusion, but what I mean is, the schema method still pops up in the suggestions.

Screenshot 2024-02-15 at 7 30 23 PM

skwowet avatar Feb 15 '24 14:02 skwowet

As shown in the screenshot, schema is not a method, but instead a property of the Elysia instance. Your original expression is not callable/has no call signatures Typescript error was thrown because you were attempting to call a property as if it were a method.

Nmans01 avatar Mar 11 '24 21:03 Nmans01

@Nmans01, just checked with SaltyAom. The schema is out, it's guard now.

skwowet avatar Mar 12 '24 10:03 skwowet