markdown

package
v0.0.0-...-207e0d5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package markdown converts OpenAPI / Swagger specifications into Markdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToMarkdown

func ToMarkdown(data []byte, opts Options) (string, error)

ToMarkdown converts an OpenAPI/Swagger JSON or YAML document to Markdown. - Detects version via top-level "swagger" (2.0) or "openapi" (3.x). - Supports auto-detection of JSON vs YAML, overridable via Options.Format.

Types

type InputFormat

type InputFormat string

InputFormat controls how the raw spec bytes are interpreted. The zero value (FormatAuto) auto-detects JSON vs YAML.

const (
	// FormatAuto lets the converter detect JSON vs YAML automatically.
	FormatAuto InputFormat = "auto"
	// FormatJSON forces the input to be treated as JSON.
	FormatJSON InputFormat = "json"
	// FormatYAML forces the input to be treated as YAML.
	FormatYAML InputFormat = "yaml"
)

type Options

type Options struct {
	Format         InputFormat
	SkipValidation bool
}

Options tune how ToMarkdown parses and validates the input spec.

Jump to

Keyboard shortcuts

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