Posts

Showing posts from October, 2024

Generating swagger doc with copilot for undocumented rails app

Was taking a peek at how to do this and I took a stab. Checked out gitlab project, fired up copilot and then (after a few iterations) hit upon this prompt: create a yaml file in openapi3 format that describes the methods and signatures of the contollers/admin/applications_controller controller assumes host are prod.myapi.com and stagin.myapi.com that host the api add detailed descriptions in the summaryfields that explain edge cases and any important side effects. Include list of tables accessed by api endpoints in the description. Format list of tables like the following (tables => {table 1}, {table 2}). Don't include character ':' in summaries, titles, or descriptions and what I got was openapi: 3.0.0 info: title: Dashboard API (Accesses various resources) version: 1.0.0 servers: - url: https://prod.myapi.com description: Production server - url: https://staging.myapi.com description: Staging server paths: /dashboard/appli