Coder Social home page Coder Social logo

Comments (17)

nenadalm avatar nenadalm commented on May 16, 2024

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.

ecordell avatar ecordell commented on May 16, 2024

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.

ecordell avatar ecordell commented on May 16, 2024

@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.

ecordell avatar ecordell commented on May 16, 2024

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.

nenadalm avatar nenadalm commented on May 16, 2024

thanks - hopefully it will be merged soon

from dredd.

OrCharles avatar OrCharles commented on May 16, 2024

Any progress on this? I am really looking forward to testing resources that are non trivial

from dredd.

nenadalm avatar nenadalm commented on May 16, 2024

@OrCharles problem is hanging here: apiaryio/Amanda#1 (nobody wants to merge for unknown reason)

from dredd.

zdne avatar zdne commented on May 16, 2024

@OrCharles @nenadalm I will check the status and will keep you updated. Sorry for the delay!

from dredd.

ecordell avatar ecordell commented on May 16, 2024

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.

zdne avatar zdne commented on May 16, 2024

Thanks @ecordell ! I will push it forward.

from dredd.

netmilk avatar netmilk commented on May 16, 2024

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.

OrCharles avatar OrCharles commented on May 16, 2024

many thanks, I was about to start patching code myself :) let me know if you want a hand with anything

from dredd.

tu1ly avatar tu1ly commented on May 16, 2024

@OrCharles it takes quite longer as we expected, but we are on good way

apiaryio/Amanda#1 (comment)

from dredd.

OrCharles avatar OrCharles commented on May 16, 2024

@tu1ly thanks, let me know if there is anything you want me to do: testing a beta release or something

from dredd.

OrCharles avatar OrCharles commented on May 16, 2024

bump

from dredd.

netmilk avatar netmilk commented on May 16, 2024

Hi, it's finally done, now. New Dredd v0.3.3 fixing this issue is released.

from dredd.

OrCharles avatar OrCharles commented on May 16, 2024

+1000 Karma points

from dredd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.