Sitelet https://github.com/codecoolture/next-joi/releases
Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Releases: codecoolture/next-joi

v2.2.1

Choose a tag to compare

@sergioalvz sergioalvz released this 05 Apr 15:17
  • Update peerDependencies to make the package compatible with Next 10 and onwards (#6)

v2.2.0

Choose a tag to compare

@sergioalvz sergioalvz released this 07 Mar 19:43

✨ New

The onValidationError function will now receive the validation error coming from Joi as a third parameter!

import withJoi from "next-joi";

export default withJoi({
  onValidationError: (req, res, error) => {
    return res.status(400).end();
  },
});

v2.1.1

Choose a tag to compare

@sergioalvz sergioalvz released this 29 Jan 19:40

This is just @sergioalvz fighting against the NPM registry 😄

v2.1.0

✨ New

The validation function has now support to check the headers property from the incoming request!

import Joi from "joi";
import withJoi from "next-joi";

const validate = withJoi({
  onValidationError: (_, res) => {
    return res.status(400).end();
  },
});

export default validate(
  {
    headers: Joi.object({
      "accept-language": Joi.string().valid("en"),
    }).unknown(),
  },
  (req, res) => {
    // This function will be only executed if the incoming request complies
    // with the validation schema defined above.
  }
);

v2.1.0

Choose a tag to compare

@sergioalvz sergioalvz released this 29 Jan 19:29

✨ New

The validation function has now support to check the headers property from the incoming request!

import Joi from "joi";
import withJoi from "next-joi";

const validate = withJoi({
  onValidationError: (_, res) => {
    return res.status(400).end();
  },
});

export default validate(
  {
    headers: Joi.object({
      "accept-language": Joi.string().valid("en"),
    }).unknown(),
  },
  (req, res) => {
    // This function will be only executed if the incoming request complies
    // with the validation schema defined above.
  }
);

v2.0.0

Choose a tag to compare

@sergioalvz sergioalvz released this 20 Nov 11:00

Breaking Changes

This version includes breaking changes. The default export is now a factory function that can be configured to have custom error handling for validation errors. The README.md has been updated accordingly to reflect the new behavior.

import withJoi from "next-joi";

export default withJoi({
  onValidationError: (_, res) => {
    return res.status(400).end();
  },
});

v1.0.0

Choose a tag to compare

@sergioalvz sergioalvz released this 06 Aug 15:19
Public release :rocket: