moonbeam is a tool to generate API client code from OpenAPI specification.
go install github.com/aide-family/moonbeam@latest
moonbeam -f openapi.yaml -o ./api
# openapi.yaml
openapi: 3.0.0
info:
title: Test API
version: 1.0.0
paths:
/test:
get:
operationId: test_get
tags: [test]
summary: Test endpoint
responses:
'200':
description: OK
components:
schemas:
TestResponse:
type: object
properties:
message:
type: string
moonbeam -f openapi.yaml -o ./api
tree -L 2 -a ./api