Repository: fastify/fastify
File: lib/warnings.js (JavaScript)

Code before:
})

const FSTDEP018 = createDeprecation({
  code: 'FSTDEP018',
  message: 'You are accessing the deprecated "request.routerMethod" property. Use "request.routeOptions.method" instead. Property "req.routerMethod" will be removed in `fastify@5`.'
})

const FSTDEP019 = createDeprecation({
  code: 'FSTDEP019',
  message: 'reply.context property access is deprecated. Please use "request.routeOptions.config" or "request.routeOptions.schema" instead for accessing Route settings. The "reply.context" will be removed in `fastify@5`.'
})

const FSTDEP020 = createDeprecation({
  code: 'FSTDEP020',
  message: 'You are using the deprecated "reply.getResponseTime()" method. Use the "reply.elapsedTime" property instead. Method "reply.getResponseTime()" will be removed in `fastify@5`.'
})

const FSTDEP021 = createDeprecation({
  code: 'FSTDEP021',
  message: 'The `reply.redirect()` method has a new signature: `reply.redirect(url: string, code?: number)`. It will be enforced in `fastify@v5`'
})

const FSTDEP022 = createDeprecation({
  code: 'FSTDEP021',
  message: 'You are using the deprecated json shorthand schema. Specify full object schema instead. It will be removed in `fastify@v5`'
})

const FSTWRN001 = createWarning({
  name: 'FastifyWarning',
  code: 'FSTWRN001',
  message: 'The %s schema for %s: %s is missing. This may indicate the schema is not well specified.',
  unlimited: true
})

const FSTWRN002 = createWarning({
  name: 'FastifyWarning',
  code: 'FSTWRN002',
  message: 'The %s plugin being registered mixes async and callback styles, which will result in an error in `fastify@5`',
  unlimited: true
})

module.exports = {
  FSTDEP005,
  FSTDEP006,
  FSTDEP007,
  FSTDEP008,
  FSTDEP009,
  FSTDEP010,
  FSTDEP011,
  FSTDEP012,
  FSTDEP013,

Review comment (suggestion):
I know, this would require some work to propagate the route's options but I think it would be helpful - just a suggestion to be more dev friendly

```suggestion
const FSTDEP022 = createDeprecation({
  code: 'FSTDEP021',
  message: 'You are using the deprecated json shorthand schema on route %s. Specify full object schema instead. It will be removed in `fastify@v5`',
  unlimited: true
})
```

Code after:
})

const FSTDEP018 = createDeprecation({
  code: 'FSTDEP018',
  message: 'You are accessing the deprecated "request.routerMethod" property. Use "request.routeOptions.method" instead. Property "req.routerMethod" will be removed in `fastify@5`.'
})

const FSTDEP019 = createDeprecation({
  code: 'FSTDEP019',
  message: 'reply.context property access is deprecated. Please use "request.routeOptions.config" or "request.routeOptions.schema" instead for accessing Route settings. The "reply.context" will be removed in `fastify@5`.'
})

const FSTDEP020 = createDeprecation({
  code: 'FSTDEP020',
  message: 'You are using the deprecated "reply.getResponseTime()" method. Use the "reply.elapsedTime" property instead. Method "reply.getResponseTime()" will be removed in `fastify@5`.'
})

const FSTDEP021 = createDeprecation({
  code: 'FSTDEP021',
  message: 'The `reply.redirect()` method has a new signature: `reply.redirect(url: string, code?: number)`. It will be enforced in `fastify@v5`'
})

const FSTDEP022 = createDeprecation({
  code: 'FSTDEP021',
  message: 'You are using the deprecated json shorthand schema on route %s. Specify full object schema instead. It will be removed in `fastify@v5`'
})

const FSTWRN001 = createWarning({
  name: 'FastifyWarning',
  code: 'FSTWRN001',
  message: 'The %s schema for %s: %s is missing. This may indicate the schema is not well specified.',
  unlimited: true
})

const FSTWRN002 = createWarning({
  name: 'FastifyWarning',
  code: 'FSTWRN002',
  message: 'The %s plugin being registered mixes async and callback styles, which will result in an error in `fastify@5`',
  unlimited: true
})

module.exports = {
  FSTDEP005,
  FSTDEP006,
  FSTDEP007,
  FSTDEP008,
  FSTDEP009,
  FSTDEP010,
  FSTDEP011,
  FSTDEP012,
  FSTDEP013,