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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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