0

I am using the Dredd tool to test my API (which resides on apiary.io).

Question

I would like to provide dredd with a path to my documentation (it even asks for it), however my API doc is on apiary.io but i don't know the exact url that points to it. What would be the correct way to provide dredd with the API path?

What did work (but not what i'm looking for)

Note: I tried downloading the api to my local drive and providing dredd with a local path to the file (yml or apib) which works fine (yay!), but i would like to avoid keeping a local copy and simply providing dredd with the location of my real API doc which is being maintained on the apiary server.

How do I do this (without first fetching the file to local drive)?

Attempts to solve this that failed

I also read (and tried) on the following topics, they may be relevant but i wasn't successful in resolving the issue - Using authentication token as environment variable - Providing the domain provided by apiary.io//settings to dredd - Providing the in the dredd command all of these attempts still produces the same result, Dredd has no idea where to find the API document unless i provide a path in my local computer to the file (which i have to download or create manually on my computer first).

Any help is appreciated, Thanks!

Shachar R
  • 311
  • 1
  • 2
  • 8

2 Answers2

0

If I understand it correctly, you would like to use dredd and feed it using the API description document residing on Apiar.io platform, right?

If so, you should be able to do that simply calling the init command with the right options:

dredd init -r apiary -j apiaryApiKey:privateToken -j apiaryApiName:sasdasdasd

You can find the private token going into the Test section of the target API (you'll find the button on the application header).

Let me know if this solves the problem for you - I'll make sure to propagate this and document it accordingly on our help page

P.S: You can also use your own reporter - in that case, simply omit -r apiary when writing the command line parameters.

Vincenzo
  • 1,549
  • 1
  • 9
  • 17
  • Vincenzo, thanks for your reply. I am actually writing the following command similar to what you wrote: dredd init -r apiary -j apiaryApiKey: -j apiaryApiName: This should identify the API documentation alright, but dredd still asks me to enter the _? Location of the API description document (apiary.apib)_ What should i enter in this field? (just hitting enter to get whatever default value dredd sets doesn't work. i also tried entering the domain provided in the settings window for my API and it didn't work also). It only worked if i had a local copy of the API... – Shachar R Aug 09 '16 at 10:06
  • Hello again, unfortunately I made a mistake - this feature is not available yet. There's an issue [here](https://github.com/apiaryio/dredd/issues/366) and it's currently being worked on. I misinterpreted my coworker's words. – Vincenzo Aug 09 '16 at 11:58
  • For now i will use apiary CLI to fetch it first - thanks for the reference to the issue - it would be a nice feature to avoid having to first fetch and then run dredd. Thanks – Shachar R Aug 09 '16 at 12:34
0

You can feed Dredd not only with a path to file on your disk, but also with an URL.

If your API in Apiary is public, the API description document (in this case API Blueprint) should have a public URL. For example, if you go to http://docs.apiblueprintapi.apiary.io/, you can see on the left there is a Download link. Unfortunately, the link is visible only for users who do not have access to the editor of the API, so you can’t see the link if you’re owner of the API. Try to log out from Apiary and the link should appear:

enter image description here

Then you can feed Dredd with the link:

$ dredd 'http://docs.apiblueprintapi.apiary.io/api-description-document' 'http://example.com:8080/api'

I agree this isn’t very intuitive and since you’re not the first one to come up with this, I think we’ll think of some ways how to make it easier.


If your API isn't public then unfortunately there's no way to get the URL as of now. However, you can either use GitHub Sync or Apiary CLI to get the file on your disk in an automated manner.

Honza Javorek
  • 8,566
  • 8
  • 47
  • 66