* This method will be called when a serializer must be setup. * Do not setup the compiler more than once * @param {object} serverOptions the fastify server options
(serverOptions)
| 151 | * @param {object} serverOptions the fastify server options |
| 152 | */ |
| 153 | setupSerializer (serverOptions) { |
| 154 | const isReady = this.serializerCompiler !== undefined && !this.addedSchemas |
| 155 | if (isReady) { |
| 156 | return |
| 157 | } |
| 158 | |
| 159 | this.serializerCompiler = this.getSerializerBuilder()(this.schemaBucket.getSchemas(), serverOptions.serializerOpts) |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | SchemaController.buildSchemaController = buildSchemaController |
no test coverage detected