Search code examples
apiblueprintapiary.iodredd

Dredd Apiary contract driven test - Is there any way to access private apiary documentation blueprint format from local dredd config?


I'm running contract driven development tests using dredd.

I know how to configure dredd tests to run either against a local or remote server, given a blueprint apib file. Typically, the relevant fields in my dredd config file will read like

blueprint: myblueprintfile.apib
endpoint: localhost:3000 <or any remote server>

I didn't find a way to automatically refer to the remote blueprint hosted on apiary though. what i would like to achieve is something along the lines of

blueprint: <remote apiary apib file>
endpoint: localhost:3000 <or any remote server>

I can basically achieve the same result by manually fetching the blueprint using apiary CLI and saving it to a local file, before running the actual dredd tests

export APIARY_API_KEY=<key>
apiary fetch --api-name=<name>

Is there a way to achieve this step directly from dredd configuration file?

Notice:

  • i'm working with an authenticated apiary private account
  • i'm not worry about the endpoint field above, my problem is having the blueprint field pointing to a remote apiary source automatically

Maybe this question is a duplicated one, but i've looked at previously related questions and didn't find anything


Solution

  • While it's possible to point to a remotely stored .apib file, it will not work for a private documentation. At this point you can either:

    • Use the GitHub Sync to get the document on your machine
    • Automate fetching the document before testing with the Apiary CLI