We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I'm having similar problem as described here: #244 and that is according to this change #206 should be working differently.
As title says: Adding allow(0) to number().positive() goes down to 0 instead of number.
In general based on the issue: #206 this behaviour should only happen when I would specify valid(0) or only(0).
valid(0)
only(0)
To Reproduce Steps to reproduce the behavior:
import Joi from "joi"; export const JobSchema = Joi.object({ uptime: Joi.number().positive().allow(0), }).meta({ className: 'Job' });
Expected behavior Generated type should be:
export interface Job { uptime?: number | 0; // or it can be just number }
Actual behavior
export interface Job { uptime?: 0; }
The text was updated successfully, but these errors were encountered:
For now workaround I figured could be to add .meta e.g.:
.meta
export const JobSchema = Joi.object({ uptime: Joi.number().positive().allow(0).meta({ className: 'number' }), }).meta({ className: 'Job' }); // results to export interface Job { uptime?: number | 0; }
Sorry, something went wrong.
Allow is working almost the same as valid this should be fixed
No branches or pull requests
Hi I'm having similar problem as described here: #244 and that is according to this change #206 should be working differently.
As title says: Adding allow(0) to number().positive() goes down to 0 instead of number.
In general based on the issue: #206 this behaviour should only happen when I would specify
valid(0)
oronly(0)
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Generated type should be:
Actual behavior
The text was updated successfully, but these errors were encountered: