text
stringlengths
0
1.82k
**Sarah Adams:** Thanks. So I got this idea like a year and a half ago. I was maintaining a ReST API; I was working for a company called Sproutling, we were building a web baby monitor, so I was building a ReST API that had multiple clients. We had custom hardware, which was sort of a base station that was monitoring r...
So we had multiple developer teams working on each of these, and since I was the only person responsible for the ReST API - well, not because of that, but I needed to have API documentation, of course. So I started using [Apiary](https://apiary.io/), because I liked the format. You can write it in markdown, and the API...
Those smaller changes started to add up a lot, and so my documentation was often really inconsistent with the actual API. So I forked to a tool called [Dredd](http://dredd.org/en/latest/), which is meant for testing new documentation against your actual API. It was pretty good, but I had to periodically just run this a...
**Brian Ketelsen:** So when you're writing your tests, how much differently do you write your tests to make the documents look appropriate? Do you have to...?
**Sarah Adams:** Not at all.
**Brian Ketelsen:** Not at all?
**Sarah Adams:** Yeah, it's super simple. There's maybe six lines of code that you have to add. Essentially, if you have really good, really thorough unit tests, like testing for user passes nil, and user passes opposed with no request data, and all of that - all of those tests are captured, and so you can see in the d...
**Erik St. Martin:** That's really interesting. So how do you have that implemented? You're statically analyzing the tests?
**Sarah Adams:** No... Actually this is what - I wrote this bit a while ago. But I think I used the HTTP tests.
**Erik St. Martin:** They're like response-recorders, and stuff like that?
**Sarah Adams:** Yeah, so I actually paused the test right before the actual test executes, and copy the request body from the request object itself and put that into a buffer somewhere, then execute the tests and copy the response data before we actually returned, and put that into the buffer as well. And then when th...
**Erik St. Martin:** Does this support header logic, too?
**Sarah Adams:** Yeah, all your headers are logged also to the same buffer, and they're in the appropriate format for the API blueprint.
**Erik St. Martin:** That's really awesome, I kind of wanna play with this.
**Sarah Adams:** Yeah, it is awesome, I love it. I use it at work.
**Erik St. Martin:** And is there a way to augment the documentation, so things that aren't necessarily captured by monitoring the requests and responses, things that you might wanna take notes on, like what appropriate values are, or things like that?
**Sarah Adams:** Yeah, so for each package, an .apib is spit out, and what you actually need to do is have sort of a -- I call it a template, but it's really just the description of your API and sort of high-level things like that. Those go at the top of the .apib file. Once all of your tests have run, you'll get back ...
**Carlisia Thompson:** That's cool.
**Erik St. Martin:** So what's the process for this? You just run this tool after you're done, so that you're kind of committing this documentation?
**Sarah Adams:** Yeah, I have it built into our CI flow. You push out some code on a feature branch, and when it's ready to land into the development branch, or whatever you use - master... You land that in, and then we have a special hook that says, "Oh, if I'm on the master branch, I need to run the combined .apib fi...
**Brian Ketelsen:** Nice.
**Carlisia Thompson:** I just thought about making this - another tool... Make a diff between the pushes, so you can see like a change log version, that would be really cool.
**Sarah Adams:** Yeah, that would be cool. And there are a lot of things that I wanna add to this. A couple people have requested Swagger support; I think that's probably more common that Apiary for API documentation.
**Erik St. Martin:** Swagger has really blown up lately.
**Sarah Adams:** Yeah. The interesting thing about Swagger though is they seem to want you to generate your sort of hammer skeletons. I'm not really sure how that fits into this sort of test-generates-docs flow, because really what they want you to do is have a spec generate the code... It's sort of cyclical. I'm not s...
**Erik St. Martin:** Yeah, they kind of fit in different parts of the workflow, right?
**Sarah Adams:** Yeah, exactly.
**Erik St. Martin:** It's that Swagger kind of... You build to the specification and then it spits out code, and it knows that it meets it, whereas this tool kind of comes in after the fact and kind of gets insight into how your API works.
**Sarah Adams:** Exactly, it's a different workflow.
**Carlisia Thompson:** Here's the perfect workflow: you do your specs, you run it, you spit out the Swagger docs, you run the Swagger docs and that then generates your codes.
**Erik St. Martin:** But I think this is interesting though, because people love Swagger, but everybody likes building their APIs in different ways, and we see that prevalent in all the number of frameworks out there for building APIs right now. But yours, it doesn't have any ties into those specific... You can write i...
**Sarah Adams:** Thanks!
**Carlisia Thompson:** Yeah. The one issue I can see with trying to make it fit in with Swagger is that Swagger has a very... Well, it has a specification, so it's strict in that way, and if you design something that is not supported - not necessarily, it wouldn't be ReSTful, but it's not supported by that spec version...
**Sarah Adams:** Well, API Blueprint has a pretty strict spec also. You just have to match the data, you have to really evaluate the spec and match the data, fit it into the spec.
**Carlisia Thompson:** Yeah, so you have to have some prior knowledge of what the spec is for the tool you're working with.
**Sarah Adams:** Sure.
**Erik St. Martin:** Alright, so I think we've got about ten minutes left, and I definitely don't want to close the show out without getting a chance to speak with you about your Women Who Go initiatives.
**Sarah Adams:** Oh, awesome.
**Erik St. Martin:** Could you tell us a little bit about that, and kind of how things are going there?
**Sarah Adams:** Yeah, sure. We're actually growing really fast at the moment. I'm sort of blown away, it's really exciting. We just launched a chapter in Tokyo, so that's really cool. I could talk about why I started it, or how I started it...
**Erik St. Martin:** Yeah, talk a little bit about what it is and how it got started, and what your goals are.
**Sarah Adams:** Sure. So I really wanted to create a safe space for women to enter the Go ecosystem. I started the group about a year ago, and I had been going to Go SF meetups since mid-2013, when they were still really small, like 30-50 people, or something. And I was often the only woman, very consistently, so I st...
Then I got accepted to talk at GopherCon early 2014, and I was actually listening to a Changelog podcast about GopherCon, and I think it was Brian who... I can't actually remember - someone asked a question like, "How can we help people get more involved in the Go community?", or something like that. And Brian suggeste...
We had our first event about a year ago. We just talked about the difficulties of being a woman in tech and a woman in the Go community, and how can we start trying to fix these issues. And I've had a meetup about every month for a year, and I think our largest event has been the Bill Kennedy workshop - we had 70 women...
The main goal of the group is just to provide a safe environment for women to learn more about Go, to explore, and hopefully the idea is that then they go to Go SF events or GopherCon, once they feel a little more safe. I think it's been working pretty well.
As far as our ten chapters around the world, women actually will message me or somehow find me on Twitter, and they'd be like "I see what you're doing and it's really cool. I wanna start a group in Denver" or wherever, and I just help them get started, and they really run with it. The number of women that have been rea...
**Brian Ketelsen:** That is so awesome to hear. I'm just all verklempt over here, so keep talking. You said you have ten chapters now, right?
**Sarah Adams:** Yes, we do. We've got five in the U.S., we've got one in Bangalore, one in London, one in Tokyo... If you go to WomenWhoGo.org you can see our list of chapters, and there are also resources if you wanna get involved, but you don't need to identify as a woman. We've got Berlin, Bangalore, Tokyo, Mexico ...
**Brian Ketelsen:** Is there information on WomenWhoGo.org for people who might be interested in starting their own chapter?
**Sarah Adams:** Not explicitly, but people have found the hello@womenwhogo.org email address there and that's usually how they contact me.