Skip to content

Breaking Response Validation with Hapi 19 and Joi 16 #40

@frankthelen

Description

@frankthelen

We are just upgrading our system from Hapi 18 / Joi 15 to Hapi 19 / Joi 16.
What we see is a very strange behavior in conjunction with etagger (5.0.3).

If etagger is plugged-in and enabled, it will cause Hapi to stringify all response payloads before passing them to Joi. This breaks all response validation except Joi.any() or Joi.string(). In our case, pretty much all GET routes, e.g., Joi.array() results in HTTP 500 and ValidationError: \"foo\" must be an array.

If etagger is out, everything is fine like before upgrading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions