Skip to content

Commit

Permalink
minor jsdoc fixes (#4855)
Browse files Browse the repository at this point in the history
* minor jsdoc fixes

* Update lib/schema-controller.js

Co-authored-by: James Sumners <james@sumners.email>

* Update lib/schema-controller.js

Co-authored-by: James Sumners <james@sumners.email>

---------

Co-authored-by: James Sumners <james@sumners.email>
  • Loading branch information
Uzlopak and jsumners committed Jun 30, 2023
1 parent 1b393ad commit 253506e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ function notFound (reply) {
* @param {object} context the request context
* @param {object} data the JSON payload to serialize
* @param {number} statusCode the http status code
* @param {string} contentType the reply content type
* @param {string} [contentType] the reply content type
* @returns {string} the serialized payload
*/
function serialize (context, data, statusCode, contentType) {
Expand Down
12 changes: 6 additions & 6 deletions lib/schema-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,28 @@ class SchemaController {
/**
* This method will be called when a validator must be setup.
* Do not setup the compiler more than once
* @param {object} serverOptions: the fastify server option
* @param {object} serverOptions the fastify server options
*/
setupValidator (serverOption) {
setupValidator (serverOptions) {
const isReady = this.validatorCompiler !== undefined && !this.addedSchemas
if (isReady) {
return
}
this.validatorCompiler = this.getValidatorBuilder()(this.schemaBucket.getSchemas(), serverOption.ajv)
this.validatorCompiler = this.getValidatorBuilder()(this.schemaBucket.getSchemas(), serverOptions.ajv)
}

/**
* 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 option
* @param {object} serverOptions the fastify server options
*/
setupSerializer (serverOption) {
setupSerializer (serverOptions) {
const isReady = this.serializerCompiler !== undefined && !this.addedSchemas
if (isReady) {
return
}

this.serializerCompiler = this.getSerializerBuilder()(this.schemaBucket.getSchemas(), serverOption.serializerOpts)
this.serializerCompiler = this.getSerializerBuilder()(this.schemaBucket.getSchemas(), serverOptions.serializerOpts)
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ function getSchemaAnyway (schema, jsonShorthand) {
*
* @param {object} context the request context
* @param {number} statusCode the http status code
* @param {string} contentType the reply content type
* @returns {function|boolean} the right JSON Schema function to serialize
* @param {string} [contentType] the reply content type
* @returns {function|false} the right JSON Schema function to serialize
* the reply or false if it is not set
*/
function getSchemaSerializer (context, statusCode, contentType) {
Expand Down

0 comments on commit 253506e

Please sign in to comment.