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

Does not support $ref properties #113

Open
2 tasks done
jpenna opened this issue Jun 25, 2024 · 4 comments · May be fixed by #126
Open
2 tasks done

Does not support $ref properties #113

jpenna opened this issue Jun 25, 2024 · 4 comments · May be fixed by #126
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jpenna
Copy link

jpenna commented Jun 25, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.28.0

Plugin version

2.6.0

Node.js version

20.15.0

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

ubuntu

Description

The plugin is failing the schema validation when there is a $ref in the response object.

In the sample code provided you can see it working without the plugin and also when the response doesn't get a $ref.

I'm using TypeBox for schema generation, but it doesn't matter. Even if you write it a plain object it continues failing.

Link to code that reproduces the bug

https://github.com/jpenna/fastify-response-error

Expected Behavior

It shouldn't crash the build.

@mcollina mcollina added bug Something isn't working help wanted Extra attention is needed labels Oct 15, 2024
@mcollina
Copy link
Member

Sorry for the long wait. I think receiving a PR to fix this would be amazing.

@diogosilva95
Copy link

@jpenna i tried your code without the plugin and it worked, why do you need that plugin?

@jpenna
Copy link
Author

jpenna commented Nov 2, 2024

@diogosilva95 It is working without the plugin, I mentioned it in the description. By "that plugin" do you mean "this plugin" I'm opening the issue? If so, I want it to validate the response I'm sending back to the user.

@diogosilva95 diogosilva95 linked a pull request Nov 3, 2024 that will close this issue
2 tasks
@diogosilva95
Copy link

@jpenna i opened a pr that fixes the problem, hopefully you will be able to validate the response soon. Cheers

@Fdawgs Fdawgs linked a pull request Nov 3, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants