Skip to content

Commit

Permalink
refactor: prefix unused params with underscores (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jan 5, 2025
1 parent efb3922 commit 9141e37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/mode/dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (fastify, opts, done) {
transformObject: null,
decorator: 'swagger',
refResolver: {
buildLocalReference (json, baseUri, fragment, i) {
buildLocalReference (json, _baseUri, _fragment, i) {
if (!json.title && json.$id) {
json.title = json.$id
}
Expand Down
2 changes: 1 addition & 1 deletion test/spec/openapi/refs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fastifySwagger = require('../../../index')
const openapiOption = {
openapi: {},
refResolver: {
buildLocalReference: (json, baseUri, fragment, i) => {
buildLocalReference: (json, _baseUri, _fragment, i) => {
return json.$id || `def-${i}`
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/spec/swagger/refs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('support $ref schema', async t => {

await fastify.register(fastifySwagger)

fastify.register((instance, opts, next) => {
fastify.register((instance, _opts, next) => {
instance.addSchema({
$id: 'subschema-two',
type: 'object',
Expand All @@ -29,7 +29,7 @@ test('support $ref schema', async t => {
}
})

instance.register((subinstance, opts, next) => {
instance.register((subinstance, _opts, next) => {
subinstance.addSchema({
$id: 'subschema-three',
type: 'object',
Expand Down Expand Up @@ -67,7 +67,7 @@ test('support nested $ref schema : complex case', async (t) => {
const options = {
swagger: {},
refResolver: {
buildLocalReference: (json, baseUri, fragment, i) => {
buildLocalReference: (json, _baseUri, _fragment, i) => {
return json.$id || `def-${i}`
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/types/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const fastifyDynamicSwaggerOptions: SwaggerOptions = {
hideUntagged: true,
stripBasePath: true,
refResolver: {
buildLocalReference: (json, baseUri, fragment, i) => `${fragment}-${i}`
buildLocalReference: (_json, _baseUri, fragment, i) => `${fragment}-${i}`
}
}
app.register(fastifySwagger, fastifyDynamicSwaggerOptions)
Expand Down Expand Up @@ -85,7 +85,7 @@ app.put('/image.png', {
}
}
}
}, async (req, reply) => {
}, async (_req, reply) => {
reply
.type('image/png')
.send(Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAgSURBVBhXY/iPCkB8BgYkEiSIBICiCCEoB0SBwf///wGHRzXLSklJLQAAAABJRU5ErkJggg==', 'base64'))
Expand Down

0 comments on commit 9141e37

Please # to comment.