openapi2kong

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 2 modules, 1 package

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.

Documentation

Index

Constants

View Source
const JSONSchemaVersion = "draft4"

Variables

This section is empty.

Functions

func Convert

func Convert(content []byte, opts O2kOptions) (map[string]interface{}, error)

Convert converts an OpenAPI spec to a Kong declarative file.

func MustConvert

func MustConvert(content []byte, opts O2kOptions) map[string]interface{}

MustConvert is the same as Convert, but will panic if an error is returned.

Types

type O2kOptions

type O2kOptions struct {
	// Array of tags to mark all generated entities with, taken from 'x-kong-tags' if omitted.
	Tags []string
	// Base document name, will be taken from x-kong-name, or info.title (for UUID generation!)
	DocName string
	// Namespace for UUID generation, defaults to DNS namespace for UUID v5
	UUIDNamespace uuid.UUID
	// Enable Inso compatibility mode
	InsoCompat bool
	// Skip ID generation (UUIDs)
	SkipID bool
	// Enable OIDC plugin generation
	OIDC bool
	// Ignore security errors (non-OIDC and AND/OR logic)
	IgnoreSecurityErrors bool
	// Ignore circular references
	IgnoreCircularRefs bool
	// Generate separate routes for each header enum even if required: false
	TreatAllHeadersAsRequired bool
	// Skip generation of separate routes for header parameter enums
	SkipRouteByHeader bool
	// Enable service reuse: when multiple paths have identical server configurations
	// and no path-level plugins, they will share a single Kong service instead of
	// creating duplicate services. This reduces resource bloat in Kong.
	ReuseServices bool
}

O2KOptions defines the options for an O2K conversion operation

Jump to

Keyboard shortcuts

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