Creating REST API Docs for your Rails App - Ebook Updates

I’m just going to start this topic. It will serve as a home for my updates that I will post every single day until my book is “finished”. I’ve been wanting to write this book for years now and I still haven’t done it. I did start it, multiple times in fact, but never made much progress. I’m using leanpub to write this book. Even though I only have written a few pages I’m just going to launch the book today as-is for super cheap, and will update the price every so often. If you happen to have found this topic and would like to support my work, please purchase a copy of my book.


(Edit: Placing this here so it shows up as the topic thumbnail)

Looks like the minimum price has to be $7.99. So I will start with that.

I’ll also use this percentage complete progress bar. I guess I’ll start with 1%. Looks like I have a long way to go.

And it’s live!

I just made several copy edits tonight, which is more than I have done in several months, so I’m off to a good start.

See ya tomorrow!

Today I made a cover for the book, and made the title shorter.

It’s not the most amazing thing ever, but it’s a start.

Whoops I missed a couple of days. Doing this daily isn’t going to be easy, but I guess I just wanted to show that I’m not perfect, and it’s going to take quite a bit of work.

For today I updated that subtitle text so that it shows up on the landing page.

Today, I wrote some text for the “About the Book” section on the main book page:

I’m sure I’ll end up changing it, but at least I have something now. And yes I’m realizing how much I’m just working on the landing page instead of writing my actual book.

Today I wrote some more for the “Why this book?” section.

All I did today was update the categories for my book, so that it will show up in those various lists on leanpub.

image

Started running through my existing instructions and added a missing bin/rails db:migrate command.

Welp! I haven’t posted an update in over a week! I know I did work on a couple things between then, but I do need to be better about squeezing in the time every single day because this book isn’t going to write itself.

Good news though! And this seriously was the highlight of my day yesterday and was so cool to wake up to and see the notification on my phone that I had sold my first pre-release copy of my book! :tada: :moneybag:

I have no idea who my new reader is, but thank you so much! :hugs:

I cleaned up some things on the current third chapter and published a new version of the book. Looks like I lost the percentage count the last time I published, whoops! So I set it to 2% and it now shows up on my book page. I think it might reset every time I publish, so I need to make sure I always set a number for it.

One thing I still need to do is write some “Teaser Text”:

I’m not really sure where that will be displayed. The description LeanPub just says “1–3 sentences to summarize your book and excite your prospective readers.”

This Meta description field, looks important though for SEO purposes.

I actually had a pretty productive morning though and finally was able to start work on the new chapter about setting up Redoc.

I also added my first image to the book, which I wasn’t totally sure how to do using their markdown editor. This image is showing the very first basic version of how our generated api docs will look in a web browser.

Yesterday I was able to deploy my API docs on GitHub Pages. Took a little bit of troubleshooting as I had some old username domain issues under my GitHub account from many years ago.

https://oblakeerickson.github.io/todo-api-docs/

Add some steps about how to setup GitHub pages and the html file to use to load your docs with redoc.

Today I just did some research for my next chapter about integrating GitHub - davishmcclurg/json_schemer: JSON Schema validator. Supports drafts 4, 6, and 7. with rswag.

Today I started the chapter on setting up json_schemer.

I’m not going to lie, I’m at the point in writing this book where as much as I really do want to write and finish this book, I keep inventing a million other new ideas I could start. Why do we do this to ourselves? Anyways, I guess I just wanted to be open about the process of actually writing a book and how hard it can be sometimes.

Started working on the chapter where we will be using

It’s a little ruby script I made to convert json responses into json schema. I should probably turn it into a gem, but I’d also be open to using some other existing tool so that I don’t have maintain it.

I worked on the to_json_schema chapter and showed how to convert a json response from our api into the json schema format.