Comments (17)
example:
server.js: http://pastebin.com/2uJeg7VW
doc.apib: http://pastebin.com/TRnZ0gEc
$ node server.js
$ dredd doc.apib http://localhost:8888
now it should throw message from the title
from dredd.
Definitely a problem that should be fixed. I see these errors from time to time as well.
The root cause can be traced back to this issue on Gavel which then points to an issue on Amanda.
from dredd.
@nenadalm I've been working on fixing this bug (it's become a problem for us) since yesterday.
The issue you linked to in Amanda doesn't actually fix the problem, unfortunately. I've applied that patch to the current codebase (the one used by gavel, anyway) and I still get the body: Validator internal error: Maximum call stack size exceeded
errors.
Since Amanda is falling behind spec (no draft-04 support, no $ref support) I decided to evaluate the other options. Gavel is well designed and it was fairly simple to switch out the json schema libraries. Here's what I found:
JaySchema - runs out of memory quickly. There may be a way to call it so that this doesn't happen, but it wasn't obvious to me.
Z-Schema - Lots of errors when testing against a real datasource. Looks like several bugs in how $ref is handled, and I didn't have any $ref fields in my schemas. (Or I was setting it up improperly somehow).
JSV - has not been updated in a long time, and has been forked countless times. Not clear which one to use, and may not be updated to future drafts.
tv4 - Works, but the error messages are nowhere near as informative as Amanda's.
I've pushed up a branch of Gavel that uses tv4, and honestly, it works pretty well...but ~20-30 unit/spec tests are failing in Gavel with tv4 instead of Amanda, and it looks pretty hopeless getting them to pass without modifying tv4 to output all of the data that Gavel wants. (I'm not sure if I can assume that certain parts of Gavel aren't working; the output that I see from my api tests with dredd look exactly the same as with Amanda, just with less informative errors and no false-positives because of call stack errors).
Which led me to try applying #32, which as I mentioned, doesn't work as far as I can see.
So that's the state of affairs. Trying to hunt down the bug in Amanda since that seems the least painful route at the moment. On the other hand, could probably use tv4, but the failings tests are concerning.
from dredd.
So it turns out that I just wasn't building things properly, and the fix in #32 does work!
I applied the patch to the new codebase so it would merge cleanly, and sent PRs on Baggz/Amanda and apiaryio/Amanda.
Once they're merged, Amanda needs to bump its version, then Gavel needs to, and then dredd can use the fix.
from dredd.
thanks - hopefully it will be merged soon
from dredd.
Any progress on this? I am really looking forward to testing resources that are non trivial
from dredd.
@OrCharles problem is hanging here: apiaryio/Amanda#1 (nobody wants to merge for unknown reason)
from dredd.
@OrCharles @nenadalm I will check the status and will keep you updated. Sorry for the delay!
from dredd.
For what it's worth, I've been using the patched Amanda in a patched Gavel in a patched fork of Dredd for months with no issue.
from dredd.
Thanks @ecordell ! I will push it forward.
from dredd.
Hi, we are working on it. We are merging Baggz/amanda and apiaryio/amanda together under apiaryio. It will be promoted in Dredd and Gavel.js afterwards. It should be done this week.
from dredd.
many thanks, I was about to start patching code myself :) let me know if you want a hand with anything
from dredd.
@OrCharles it takes quite longer as we expected, but we are on good way
from dredd.
@tu1ly thanks, let me know if there is anything you want me to do: testing a beta release or something
from dredd.
bump
from dredd.
Hi, it's finally done, now. New Dredd v0.3.3 fixing this issue is released.
from dredd.
+1000 Karma points
from dredd.
Related Issues (20)
- Package dependency triggers NPM advisory (1179) HOT 5
- [Question] How to send form-data (not file, it's string)? HOT 1
- Skipped tests when using square brackets in get parameter name HOT 5
- Package dependency triggers NPM advisory (1696) HOT 1
- [Suggestion] Add timeout
- vulnerability CVE-2020-7598 is introduced by package minimist HOT 1
- dredd init fails when travis ci integration is requested HOT 1
- API description parser error
- oneOf doesn't work as expected
- [Question] Is it possible to split hooks.js?
- Update latest image on Dockerhub
- Add the ability to issue warnings instead of errors for hyphens in Openapi request parameters.
- Dredd doesn't make consistency check between OpenAPI schema and example
- Improved documentation for running dredd in CI / docker
- Empty body with x-www-form-urlencoded
- Multiple status code exclusion in if statement in webhook
- Issues on Paramaeters Example with Swagger.JSON
- Request library is deprecated
- Head type requests not working
- Is `dredd` dead? Please don't abandon this amazing project! HOT 1
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 dredd.