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

fix: include schema option in route declaration #149

Conversation

abahernest
Copy link
Contributor

@abahernest abahernest commented Mar 6, 2024

Include schema definition when declaring route.

I noticed that you added the generated json schema definition to fastify via the method fastify.addSchema()
image

But you didn't add the generated routes schema when you iteratively declared all the routes.
image

I noticed this while using the library alongside @fastify/swagger and it couldn't generate documentation for the routes that were already declared.
Adding the generated schema to fastify.route() fixed it for me.

@abahernest abahernest requested a review from Coobaha as a code owner March 6, 2024 16:38
@abahernest abahernest closed this Mar 6, 2024
@abahernest abahernest deleted the fix/include-schema-option-in-route-declaration branch March 6, 2024 16:42
@abahernest abahernest restored the fix/include-schema-option-in-route-declaration branch March 6, 2024 16:44
@abahernest abahernest reopened this Mar 6, 2024
@Coobaha
Copy link
Owner

Coobaha commented Mar 6, 2024

@abahernest Thank you for the contribution. Could you please bring context to the change?

I wonder why the tests are failing in CI. Did you have a chance to run tests locally?

@abahernest
Copy link
Contributor Author

@abahernest Thank you for the contribution. Could you please bring context to the change?

I wonder why the tests are failing in CI. Did you have a chance to run tests locally?

I've fixed the failing test and added a description to the PR.

@Coobaha Coobaha merged commit 81dd230 into Coobaha:main Mar 7, 2024
5 checks passed
@Coobaha
Copy link
Owner

Coobaha commented Mar 7, 2024

Thank you!

@abahernest
Copy link
Contributor Author

You're welcome. Glad to help 💪

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.

2 participants