Add response vs model / spec validation #3583
Replies: 4 comments
|
Absolutely.
We had it to be slated as a part of the unit testing feature-set but was cut from scope due to timing. We haven't really had time to build it out yet, the idea was to take the spec and generate unit tests based on it for the user like you mention under the alternatives so you wouldn't have to. Would that be a viable solution? |
|
Hey, thanks for your quick reply. That sounds like a solution - as long as the error reporting is good ;) If you take a look at assertible.com for example, the reporting is pretty bad imho, like "something is not good somewhere over there". But a very good solution will probably be a huge pile of work, both technically and on the UX side. As a user I'd expect the tool not just to tell me the json path to where it failed but to show me in the spec what was expected and what I actually got. (Ideally even with suggestions how to fix it - like "you specified string but got null, add null/nullable here?") |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
not stale |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Either I'm blind and cannot find this or I must be awkward - this feature seems to be quite essential to me (and pretty much half of what assertible.com does):
I'd like to be able to validate my requests from the
DEBUGview against my model spec defined in theDESIGNview. And/or I'd like to be able to automatically set up tests for my spec in theTESTview. How come nobody has requested this yet?Describe the solution you'd like
When I hit the
DEBUGtab insomnia creates my paths/requests for me, great! ('cept for some minor issues). But how can I check if the responses I receive actually validate against the model/spec? This should be done automatically or at least be reachable with one click.When I hit the
TESTtab insomnia presents me with the requests I specified in theDEBUGtab, great! But why aren't there tests to check against my spec by default? They should be generated automagically or be reachable with one click.Describe alternatives you've considered
Alternatively I could manually write a test
expect(body).to.be.an(xyz) ...until I have manually recreated the whole model spec ... :(Additional context
Atm I'm reverse engineering an API so I write the spec against the responses I see. After I'm confident with what I wrote I'd like to validate that my spec actually matches the response(s). And in the last step I'd like to generate client code / SDK to use in my application.
All reactions