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

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

Add an ability to attach json schema to request with a RequestSchema decorator
@coveralls
Copy link

Pull Request Test Coverage Report for Build 63f579de-c26f-456f-827f-1ddd0f85fdbe

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.006%) to 89.298%

Totals Coverage Status
Change from base Build 44c104f1-8e85-45d8-85b0-095b2f828590: 0.006%
Covered Lines: 7151
Relevant Lines: 8008

💛 - Coveralls

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