openapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package openapi reads OpenAPI documents into arch.APIDocument: each operation's method, path template and declaring line, and the servers' base paths. It parses through github.com/getkin/kin-openapi, resolving $ref across files; a Swagger 2.0 document is converted to OpenAPI 3 first, through kin-openapi's openapi2conv, and its lines are then unknown. Every file is read through the reader the shell passes, so a document cannot make anarch-lint read outside the repository, and nothing is fetched over the network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(ctx context.Context, src Source) (arch.APIDocument, error)

Parse reads the OpenAPI document src names.

Types

type ReadFunc

type ReadFunc func(file string) ([]byte, error)

ReadFunc reads a file the document refers to, by its absolute path.

type Source

type Source struct {
	File string
	Name string
	Read ReadFunc
}

Source is a document to parse: its absolute path, the name positions give it, and how to read it and every file it refers to.

Jump to

Keyboard shortcuts

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