engine

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package engine provides the core OpenAPI generation engine used by both the CLI and the generator package.

Index

Constants

View Source
const (
	// Default values for OpenAPI generation
	DefaultOutputFile         = "openapi.json"
	DefaultInputDir           = "."
	DefaultTitle              = "Generated API"
	DefaultAPIVersion         = "1.0.0"
	DefaultContactName        = "Ehab"
	DefaultContactURL         = "https://ehabterra.github.io/"
	DefaultContactEmail       = "ehabterra@hotmail.com"
	DefaultOpenAPIVersion     = "3.1.1"
	DefaultMaxNodesPerTree    = 50000
	DefaultMaxChildrenPerNode = 500
	DefaultMaxArgsPerFunction = 100
	DefaultMaxNestedArgsDepth = 100
	DefaultMaxRecursionDepth  = 10
	DefaultMetadataFile       = "metadata.yaml"
	CopyrightNotice           = "apispec - Copyright 2025 Ehab Terra"
	LicenseNotice             = "Licensed under the Apache License 2.0. See LICENSE and NOTICE."
	FullLicenseNotice         = "\n\nCopyright 2025 Ehab Terra. Licensed under the Apache License 2.0. See LICENSE and NOTICE."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine represents the OpenAPI generation engine

func NewEngine

func NewEngine(config *EngineConfig) *Engine

NewEngine creates a new Engine with the given configuration

func (*Engine) GenerateOpenAPI

func (e *Engine) GenerateOpenAPI() (*spec.OpenAPISpec, error)

GenerateOpenAPI generates an OpenAPI specification from the configured input directory

func (*Engine) ModuleRoot

func (e *Engine) ModuleRoot() string

type EngineConfig

type EngineConfig struct {
	InputDir           string
	OutputFile         string
	Title              string
	APIVersion         string
	Description        string
	TermsOfService     string
	ContactName        string
	ContactURL         string
	ContactEmail       string
	LicenseName        string
	LicenseURL         string
	OpenAPIVersion     string
	ConfigFile         string
	APISpecConfig      *spec.APISpecConfig // Direct config object (takes precedence over ConfigFile)
	OutputConfig       string
	WriteMetadata      bool
	SplitMetadata      bool
	DiagramPath        string
	MaxNodesPerTree    int
	MaxChildrenPerNode int
	MaxArgsPerFunction int
	MaxNestedArgsDepth int
	MaxRecursionDepth  int

	// Include/exclude filters
	IncludeFiles     []string
	IncludePackages  []string
	IncludeFunctions []string
	IncludeTypes     []string
	ExcludeFiles     []string
	ExcludePackages  []string
	ExcludeFunctions []string
	ExcludeTypes     []string
	SkipCGOPackages  bool
	// contains filtered or unexported fields
}

EngineConfig holds configuration for the OpenAPI generation engine

func DefaultEngineConfig

func DefaultEngineConfig() *EngineConfig

DefaultEngineConfig returns a new EngineConfig with default values

Jump to

Keyboard shortcuts

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