Open yonjah opened 6 years ago
Hey there! So glad you've got it working, and thanks for checking it out and giving feedback! All feedback is greatly appreciated.
Regarding your startup woes, yeah I need to bump my dependency versions. In the next couple of days I will publish a v3 major update to bring everything current. Going to do it as a major so that I can bring in significant breaking changes in Joi and also drop support for Node 4 since it is well outside of maintenance.
For your specific questions:
schema.describe()
is stable and safe to rely on, while internals are not. So unfortunately it is ultimately safer for me to continue to use the describe
output for flags and options since those should only break in major version of Joi, while Joi _internals can break at any time in a patch.Thanks again for taking the time to open this up! Conversations like this are the best way for the usability and power of Felicity to improve! Let me know if you have any followup questions, or if I didn't address something sufficiently :D
HI @WesTyler Thank you for your answers.
With the fist point I was actually meaning the opposite. Using schema.describe()
seems like the right way to go, But after getting the description the schema is regenerated again from the description (using helpers.descriptionCompiler
) It seem like most issues I was having were since the recompilation steps failed so I was wondering why it is necessary at all.
I see you just published v3 to npm I'll check it out. Thanks!
@WesTyler I tried to have a go at implementing my own generator just following the description provided from Joi
it seem like most of it is working OK but there are a few edge cases where the description is just not good enough to deduce a valid example.
With regards to overriding generated values I allow passing a method that will replace the generated values depending on the value that the library generated and the actual description.
This is not only useful for the override but also for custom Joi versions. the replace function can inspect the description and if it's of a custom property replace it with a valid one.
It is still a major WIP and I was kinda hacking Joi tests to get it to work so the design is not that great. But if you think any of this makes sense to be added into felicity context feel free to use it.
Hi I just started using Felicity for automatically Fuzz test my hapi routes and overall It's working great. Initially I couldn't get it to work as is and I had to add some minor hacks to get it to work ( I think mostly because I use Joi 13.x and felicity is using Joi 11.x).
So I have a few suggestions / questions trying to figure out if I'm using it wrong or can implementation improve.