Questions tagged [dredd]

Dredd is a command-line tool for testing API documentation written in API Blueprint format against its backend implementation.

From the github page of dredd:

Dredd is a command-line tool for testing API documentation written in API Blueprint format against its backend implementation. With Dredd you can easily plug your API documentation into the Continous Integration system like Travis CI or Jenkins and have API documentation up-to-date, all the time. Dredd uses the Gavel for judging if a particular API response is valid or if is not. If you are curious about how decisions are made, please refer to Gavel's behavior specification.

60 questions
1
vote
1 answer

How to provide separate examples for each HTTP status code?

I run into problem while trying to instruct Dredd to issue a different requests to trigger two distinct scenarios: success with code 201 and failure with code 400. I tried to setup a separate example per HTTP status code but couldn't manage to do…
lessless
  • 13
  • 4
1
vote
2 answers

How to make local library available as a installed module on Node.js

Have a look at Dredd, for example, it makes the library Hooks available when you are running a script with the dreddcommand. Command line $ dredd [...] --hookfiles=./hooks.js hooks.js const hooks = require('hooks'); ... How does it work?
Victor Ferreira
  • 5,153
  • 10
  • 53
  • 97
1
vote
1 answer

Validate OpenAPI response with dredd

I have an OpenAPI v3 specification file with the following (showing just fragments): paths: /global/name: get: description: Some description tags: - Global settings operationId: getGlobalSettingsName responses: #…
y.luis
  • 1,642
  • 3
  • 20
  • 37
1
vote
1 answer

Calling api gateway returns 403 and error about api key within CI but is fine outside of CI (Codebuild)

Using Cloudformation I have created an API Gateway and Usage Plan and then use the CLI/SDK to create an API Key. All this happens within our CI process. Then we test that the api returns the correct results (using dredd), however it fails with the…
user1584120
  • 979
  • 1
  • 14
  • 30
1
vote
1 answer

How to test error codes with swagger and dredd?

Any Idea how the rest api error codes can be tested with Dredd in combination with swagger .yaml file? Is there a best practice how to test all the different errors for the paths? Example: Path /task/{id} can have 3 type of responses: 200 ->…
Waldemar
  • 93
  • 11
1
vote
1 answer

How to pass URI parameters in Dredd

I'm new to Dredd and wanted to run the uber.yaml found here. However, I keep running into the following error(s): info: Configuration './dredd.yml' found, ignoring other arguments. error: Compilation error in file 'uber.yaml': Required URI parameter…
Mosinel
  • 145
  • 1
  • 9
1
vote
1 answer

API Blueprint and Dredd - Required field missing from response, but tests still pass

I am using a combination of API Blueprint and Dredd to test an API my application is dependent on. I am using attributes in API blueprint to define the structure of the response's body. Apparently I'm missing something though because the tests…
Alex Seifert
  • 51
  • 10
1
vote
1 answer

How to specify Content-Type of all responses once in API Blueprint?

In order to satisfy Dredd, I have to write this for every response in my API Blueprint document: + Response 201 (application/json; charset=utf-8) Is there a way to specify the media type ((application/json; charset=utf-8)) once, globally, for every…
Ilya Vassilevsky
  • 947
  • 6
  • 14
1
vote
1 answer

Unexcepted failed Gavel/Dredd test

Can anyone help me figure out why this Dredd test fails? It looks fine to me: fail: GET /device/2/battery duration: 260ms fail: body: Real and expected data does not match. request: body: headers: User-Agent: Dredd/0.6.0 (Darwin 14.3.0;…
chrislondon
  • 9,680
  • 5
  • 23
  • 63
1
vote
2 answers

How to install Apiaryio Drafter on Windows 8?

I wanted to install apiaryio/drafter on windows. I installed python 2.7 and visuall studio 12 "Full version". It needed to add some folders to system path because of not finding some files like "mspdb110.dll". But the latest problem related to…
MJBZA
  • 3,579
  • 4
  • 34
  • 67
1
vote
1 answer

npm - Questions about the arguments of the command lines of installed node modules

This question might not be related to npm specifically, but more about command lines in general. I have installed Dredd (https://github.com/apiaryio/dredd) and I am trying to execute a command that needs to look like this: dredd
user1834464
1
vote
1 answer

Jenkins & dredd. "npm ERR! Failed at the protagonist@0.8.0 install script"

I'm trying to integrate dredd apiary tests into Jenkins. I followed these steps to install NodeJS, npm and dredd on Jenkins (on Linux): https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin While running the test I got this ERR message: npm…
1
vote
1 answer

How to validate response with dredd?

I'm trying to check my api implementation with my documentation written in blueprint. I've expected that dredd will fail when json returned from server will be different than specified in documentation. To check this I've copied dredd-example. First…
piotrze
  • 429
  • 5
  • 14
0
votes
0 answers

Running dredd test on Go app with circleci

I'm having trouble setting up ci for my Go app. It uses dredd for test which I kick off with the following command dredd api-description.apib http://127.0.0.1:3000 In order for this to work, I must have the go app running in the background. And my…
Kaigo
  • 563
  • 8
  • 22
0
votes
1 answer

Grape Swagger does not show up Example param

I'm using grape-swagger gem to produce swagger documentation for dredd. I have such params: params do requires :id, type: Integer, documentation: { x: { example: 1 } } end Grape swagger ignores example param. Instead of this: { "in": "path", …
slim1979
  • 28
  • 4