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

Infer type schema #514

Merged
merged 5 commits into from Sep 8, 2022
Merged

Infer type schema #514

merged 5 commits into from Sep 8, 2022

Conversation

DanieleFedeli
Copy link
Contributor

@DanieleFedeli DanieleFedeli commented Aug 29, 2022

Checklist

This PR is linked to #509 and aims to propagate schema type to the final function

This comment showed the outcome.

DanieleFedeli and others added 3 commits August 29, 2022 13:18
* Added type inference

* Test cases with tsd

* Allow manual inference
@DanieleFedeli DanieleFedeli marked this pull request as ready for review August 29, 2022 12:56
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.

I am not really convinced to add json-schema-to-ts as dependency for this project.

However, I do agree we should provide some generic params for the input validation.

@Liam-Tait
Copy link

Liam-Tait commented Aug 30, 2022

@climba03003 I agree. The implementation should work across json schema libraries.

I detailed why a generic only extending object is better for cross library support here. #509 (comment)

Putting the onus on the user to provide the correct type is a good trade off for flexibility.

@DanieleFedeli
Copy link
Contributor Author

@climba03003 I agree. The implementation should work across json schema libraries.

I detailed why a generic only extending object is better for cross library support here. #509 (comment)

Putting the onus on the user to provide the correct type is a good trade off for flexibility.

So if everyone is ok I can update the PR

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

@Liam-Tait
Copy link

Nice. Thanks @DanieleFedeli I appreciate you

@mcollina mcollina merged commit 3a737e2 into fastify:master Sep 8, 2022
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.

None yet

4 participants