Support for Joi 14 | Example
See original GitHub issueContext
- hapi-swagger version: 9.1.2
- hapi: 17
- Joi: 14
What are you trying to achieve or the steps to reproduce?
We have recently upgraded our hapi from version 16 to 17, Joi from 12 to 14 and hapi swagger from 7 to 9. Since than our examples on the documentation page are coming incorrect.
Previous
{
"someField": "someValue"
}
Now
{
"someField": {"value": "someValue"}
}
Json schema looks like this
{"someField": Joi.string().example("someValue")}
because of this if someone clicks on example and click “Try It out” it gives bad request because schema doesn’t allow “value”.
I guess this is related to Joi 14 in which examples have started to come in value. Is there any workaround, options or plan to fix this?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
Joi — awesome code validation for Node.js and Express
Validation of data is an interesting topic, we tend to write code that looks really horrible in the sense that it contains a...
Read more >How To Use Joi for Node API Schema Validation - DigitalOcean
In this example, you will create validation rules using Joi to validate an email, phone number, and birthday for a request to create...
Read more >14.0.0 Release Notes · Issue #1615 · hapijs/joi - GitHub
Summary This major version introduces a lot of breaking changes, trying to fix some long lasting quirks. Most of the breaking changes should ......
Read more >This version has been deprecated - joi - npm
Author message: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest ...
Read more >NodeJS and Express API Request Schema with Joi Validation
Widely accepted and well-known package for data validation. Supports validation based on the schema. Let us start with creating a simple demo ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please fixed code in lib/properties.js line 221 as following:
https://github.com/glennjones/hapi-swagger/releases/tag/v9.3.2 contains compatibility fix for Joi 14 and examples.