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

docs(reference/typescript): remove type provider from typebox example #5576

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jscheffner
Copy link

I made some small adjustments to the Typescript docs:

  • I removed the type provider from the Typebox example. The example uses both a type provider and a generic which makes one of them obsolete. Also to my understanding this part of the docs is supposed to show how to use those libraries without type providers. There's a separate documentation of the type providers.
  • I rephrased some sentences, just minor things.

Checklist

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 17, 2024
Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

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

Make sense to remove the .withTypeProvider.
It is duplicated.

@climba03003 climba03003 requested a review from Fdawgs July 19, 2024 06:01
docs/Reference/TypeScript.md Outdated Show resolved Hide resolved
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

I don't understand why the type provider has been removed. Can you clarify?

@jscheffner
Copy link
Author

I don't understand why the type provider has been removed. Can you clarify?

Yes I can. There are two mechanisms to get the handler typed:

  • You can use the route generic
  • You can use a type provider so you don't have to use the generics

But it doesn't help to use both. So in the example there should either be no type provider or no generic. There's a link to the type provider docs just above the examples. There you can find examples using the type providers. Also it says "Below is how to setup schema validation using vanilla typebox and json-schema-to-ts packages." So I think the purpose of the examples was to show how to use the libraries with generics.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants