Few questions about RAML 0.8 w/Abao


Hi all,

I recently started using RAML 0.8 and Abao to create API documentation/testing. After quite a bit of trial and error, I was able to get it going! In doing so, however, I had of some questions I was hoping to get clarification on:

  1. How can I actually test multiple states for the same route if I can’t overload the method? E.g. suppose I declare that the potential responses are 200 and 401. I can use a trait to provide auth so that the 200 works, but then the 401 will fail, and vice versa. Without being able to GET once with auth and once without, this doesn’t seem possible. Is it best practice to do this with a hook?

  2. Along the lines of #1, how would I test for a 404 in my case? My routes are like api/sites/{siteId}/dashboard/XYZ, and the app throws a 404 for invalid siteId. I currently specify a uriParameter right under the /{siteId} resource with an example siteId, but seeing as the statuses 200, 401, 404 are under XYZ, I could never get there without specifying a siteId, hence it isn’t possible to get a 404 that way. Should this be a hook?

  3. How can I declare in a schema that there are multiple valid types for response? E.g. property X is an integer OR null?

  4. What’s the best practice for adding auth tokens to the tests since it’s not a good idea to check it into code? Would it be to do it in a beforeAll hook and pick it up in env vars in the hook code?

Thank you for reading!


Maybe repost it into their Github repo as well? Not sure if the devs are looking on that forum as well.


Thanks @christian_vogel! Will likely do that if there are no further responses here.