openapi2go

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 3 Imported by: 0

README

openapi2go

A simple Go code generator for OpenAPI specifications.

Usage

Generate Go code from OpenAPI specifications

Usage:
  openapi2go [flags]

Flags:
      --config string          Path to a configuration file
  -h, --help                   help for openapi2go
      --output string          Path to the generated code output
      --package-name string    Name of the output package
      --specification string   Path to an OpenAPI specification file
Configuration

Configuration can be provided with --config to customize the generated output. Currently only a few options are supported.

packageName: petstore # The Go package name to use. e.g. `package petstore`
types:                # Override output by type, structure is defined by [config.go](./pkg/config/config.go)
  Pet:                # Selects the type matching the name defined in '.components.schemas.*'
    fields:           # Configuration for the fields on `Pet`
      category:       # Selects the field matching the name defined in '.components.schemas.Pet.properties.*'
        type: any     # Override the type specified by '.components.schemas.Pet.properties.category.type'

Build

make bin/openapi2go

Test

make test

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
gen
ux

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL