Comments (21)
(Edited to add string.regex
support)
from felicity.
(Edited to add any.valid
support and string.insensitive
)
from felicity.
(Edited to add string hex
, alphanum
, token
, creditCard
, hostname
, and uui
)
from felicity.
(Edited to add any forbidden
, strip
, and allow
)
from felicity.
(Edited to add function arity(n)
, minArity(n)
and maxArity(n)
)
from felicity.
(Edited to add array single
)
from felicity.
(Edited to add string ip
)
from felicity.
(Edited to add string uppercase
and lowercase
)
from felicity.
@WesTyler I don't think all of these API contracts from joi
needs to be supported. It looks like some of these contracts are actually actions and not validations that we can reverse generate a value from. Check this out. I started updated the initial list with should not need for your review.
from felicity.
@WesTyler Looks like you already took care of date.format([string])
. I'm looking at here.
from felicity.
@lamchakchan re: date.format
you're right. I updated the README but not this issue when I made the PR. Issue is now updated. Thanks!
For the action contracts, you're right. I want to have at minimum a test on Felicity.entityFor though, just to make sure there are no unknown Joi internals that interfere with how Felicity is interacting with the describe
api for those options.
from felicity.
(Edited to indicate string.truncate
, string.trim
, and string.replace
are tested and have no problems.)
from felicity.
(Edited to add object rename
)
from felicity.
(Edited to add object and
and or
)
from felicity.
@WesTyler seems like the Object.type()
API is going to require some Joi PR's to add pass through for Function:constructor
pointers. As of right now, when you setup a schema with the following:
let CustomClass = function() {};
CustomClass.prototype = {};
Joi.object().keys({
prop1 : Joi.any()
}).type(CustomClass);
We get from Joi
in their schema
the following:
{
...
_tests : [{
func : [Func], // not of type CustomClass
name : 'type',
arg : 'CustomClass'
}]
}
There is a way for us to create a new constructor based off of the arg
value. But this then becomes a totally new Object entity that does not validate when using instanceof
keyword against the original one that was defined.
from felicity.
(Edited to add object unknown
)
from felicity.
(Edited to add object schema
)
from felicity.
(Edited to indicate lack of coverage on new Joi v10 features: boolean().truthy()
/.falsy()
and string().regex(/pattern/, { invert: true })
)
from felicity.
(Edited to add object type
)
from felicity.
(Edited to add boolean truthy
and falsy
)
from felicity.
Closing this to mark where v1 is at the time of release.
from felicity.
Related Issues (20)
- Generate options are not getting passed down in recursive cases HOT 4
- felicity.example() throws an error for Joi.object().default(<OBJECT>) HOT 3
- Example with bool type throws HOT 4
- .example() on string().required().valid(a, b, c).default(b) does not take default into account HOT 3
- Respect .strip() in entityFor constructors
- Joi.func() creates Objects as examples HOT 3
- instance validation fails silently when nested array items do not pass validation. HOT 3
- A bunch of questions and feature suggestions :-) HOT 3
- 3.0.0 Release Notes
- Default `stripUnknown` on entityFor Constructor input leads to weird behavior
- Investigate - nested optional props in a required object
- Investigate - Node@10 regex support for generating examples using lookaround assertions
- Update to Joi 14 HOT 6
- Update hapi core modules HOT 1
- TypeScript support HOT 1
- Plans to support Joi 16 HOT 11
- Joi the max() validation is not respected.
- Does not support Joi's array().has(...)
- Invalid mock returned if schema uses any.when
- Typescript support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from felicity.