gendoc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gendoc provides a turnkey main for generating a Registry's OpenAPI document from the command line, so an application's generator command is a single line:

//go:generate go run ./cmd/openapi-gen -out ./openapi

package main

import (
	"github.com/antlss/oapi/tools/gen_doc"
	"example.com/app/api"
)

func main() { gendoc.Main(api.Registry()) }

Flags: -out DIR, -format LIST (json,yaml), -base FILE, -no-validate.

It lives under tools/ alongside any future code generators (e.g. an API mock generator), each a small package that wraps the core library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(reg *oapi.Registry)

Main parses generation flags, writes the registry's OpenAPI document to disk and exits non-zero on failure. It is the body of a generator command; call it from main with your application's Registry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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