Closed nicolagusso closed 2 years ago
This plugin use it's own ajv
instance and it is not shared with fastify
.
I do not see any way you can pass the ajv
plugin to this plugin.
I think a PR to allow applying plugin to this plugin ajv
instance is the solution.
Would you like to send a PR to address this issue?
Reference for how to implement the plugins option. https://github.com/fastify/ajv-compiler/blob/main/index.js#L53-L61
Hi, thanks for the response! 😃
I would like to try. Just to be sure of understanding correctly what you are asking for. You would like to implement the plugins
option as it's currently implemented inside the ajv-compiler
component, right? 🤔
Also, I wanted to share a thought of mine. Since this is a plugin for Fastify, wouldn't be better to use the very same instance of ajv used by Fastify itself? 🤔
Prerequisites
Fastify version
3.17.0
Plugin version
0.1.0
Node.js version
16.2.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
10.15.7
Description
Hi, I'm trying to use this plugin to validate the responses generated by my Fastify app. In addition to Fastify, in order to generate programmatically all the routes from an openapi specification, I'm using fastify-openapi-glue.
Each time I try to run my app I get the following error:
unknown format "float" is used in schema at path "..."
In order to solve this issue i tried to use others libraries in order to integrate the missing format, for example:
I tryed also to override the instance of ajv used by Fastify with another one.
Steps to Reproduce
Expected Behavior
Shouldn't throw the error reported in the description.