openapiimport

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDocumentBytes = 16 << 20

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Package string
	// GoPackage is the generated Go import path, without a semicolon package
	// alias. An OpenAPI document cannot supply this repository identity.
	GoPackage string
	Service   string
}

Options controls the small amount of information OpenAPI cannot provide for a protobuf contract. Package and GoPackage are required. Service defaults from info.title.

type Result

type Result struct {
	Source   []byte
	Warnings []string
}

Result is a reviewable protobuf source file plus non-fatal fidelity notes.

func Convert

func Convert(spec []byte, options Options) (*Result, error)

Convert translates a bundled OpenAPI 3.0/3.1 document into reviewable protobuf source. The source becomes canonical after import; this function is deliberately not a round-trip synchronization engine.

Jump to

Keyboard shortcuts

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