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

feat(fastify): add decorator for custom schema #14789

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

Conversation

piotrfrankowski
Copy link

@piotrfrankowski piotrfrankowski commented Mar 17, 2025

Add an ability to attach json schema to request with a RequestSchema decorator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Currently, there is no easy way of using fastify's schema property and adding a response schema can have positive impact on performance source

Issue Number: N/A

What is the new behavior?

This PR adds a new decorator RequestSchema that takes a schema object and sets it as schema property on fastify route doc

Does this PR introduce a breaking change?

  • Yes
  • No

@coveralls
Copy link

coveralls commented Mar 17, 2025

Pull Request Test Coverage Report for Build 02802516-d592-4b74-9d4a-468ecef0e4f2

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.007%) to 89.315%

Totals Coverage Status
Change from base Build 9a00696e-40a7-448c-9951-d94a318de4a0: 0.007%
Covered Lines: 7155
Relevant Lines: 8011

💛 - Coveralls

@piotrfrankowski piotrfrankowski force-pushed the pf/feat/add-fastify-schema-decorators branch 2 times, most recently from 1ea8967 to e764223 Compare April 8, 2025 10:24
Add an ability to attach json schema to request with a RequestSchema decorator
@piotrfrankowski piotrfrankowski force-pushed the pf/feat/add-fastify-schema-decorators branch from e764223 to 846d35a Compare April 8, 2025 11:31
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