DEV Community

Ofer Lis
Ofer Lis

Posted on

ChatGPT: how I used it to convert HTTP requests to OpenAPI document

Hi everyone! 👋
As a junior software developer, I try to learn as much as I can about new technologies and how to enhance my skills.
Contributing to open-source projects is one of the best ways to do that.

The following article shows one of my recent contributions to
Sharkio, using ChatGPT.

What is Sharkio? 🦈

Sharkio is a developer tool for API developers. It makes the developer's work easier by aggregating and presenting the requests sent to our services in a clean and clear UI. It also allows the mocking of HTTP requests to make it easier for backend and frontend developers to work efficiently together.
Sharkio is an open-source project written in TS with a growing community and a long list of features requested by its developers and users.

My contribution - HTTP requests to OpenAPI

My contribution to Sharkio focused on a highly requested feature: auto-generation of standardized OpenAPI documentation using recorded HTTP requests. This feature addresses the need for consistent and comprehensive documentation in API development.

Why use ChatGPT?

Using ChatGPT in my development process was a game-changer. It reduced the time spent on formatting the OpenAPI document structure, saving me hours of research. This freed up my focus to prioritize coding and implementation, leading to greater efficiency and productivity in my work.

My prompt:

ChatGPT prompt

and the chat's output:

ChatGPT output

A few prompts later, I end up with 3 interface to represent the OpenAPI document:

openAPI interfaces

I modified the code to match the code structure, extracted interfaces and added a form to get the name and version type in the UI.

You could see the code [in the PR].(https://github.com/idodav/sharkio/pull/95)

The outcome was a form and a page to create an OpenAPI document using HTTP requests:

openAPI generation UI

Join us 👨‍💻 👩‍💻

If you're interested in learning more about Sharkio, I invite you to visit the repository and explore the project. Feel free to use the tool, provide feedback, and join the growing community of contributors. We welcome developers of all levels of expertise to join us on this exciting journey.

Top comments (4)

Collapse
 
idodav profile image
Ido David

@oferlis This is amazing. You contribution to the project is much appreciated!

Collapse
 
oshriasulin profile image
Oshri Asulin

Amazing @oferlis , it's looks interesting and really educational

Collapse
 
acecodept profile image
Ace-Code

Amazing stuff!
Why people aren't using it more?

Collapse
 
gal_oiring profile image
Gal oiring

@oferlis Looks like a great way to make the conversion faster !