Django API Documentation

Honestly, most engineers and developers do not like to do that thing called “documentation”. It has been longer than I’m willing to admit here since I was in college. Back in my day, the saying went “The code is the specification”. And, truth be told, I have seen too much documentation that was both unclear and had stale information. Especially in the world of software engineering where the only thing constant is change itself. So, I do hesitate in writing documentation only because people rarely read it (why do something if it is not going to be used).

An API is different. It is beneficial to have a front-end developer to understand what goes on in the back-end. However, I don’t want those developers to have to go through and read my code. So, writing API Documentation is critical for application development when you have a separation of front-end developers and back-end developers.

I could have written my API documentation using Swagger to generate the OpenAPI spec in yaml format. Or use Postman to create a Postman collection. However, I’ve been using ChatGPT for a while now, so I decided to give ChatGPT a shot. All I had to do was put the urls.py and views.py files into the chat session and… within seconds, I had both a yaml file and a table built for each of my endpoints! Unfortunately, WordPress by default does not allow for yaml files to be uploaded and stored for security reasons. It did not feel worth it to spend hours getting WordPress to enable me to upload yaml files if nobody would ever read them.

I did however publish the tables that WordPress generated on my re-formatted application information pages.