files

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package files provides file resolution and pattern matching for OpenAPI specs.

Index

Constants

This section is empty.

Variables

View Source
var OpenAPIExtensions = []string{".yaml", ".yml", ".json"}

OpenAPIExtensions are file extensions that may contain OpenAPI specs.

View Source
var OpenAPIPatterns = []string{
	"openapi",
	"swagger",
	"api-spec",
	"api_spec",
}

OpenAPIPatterns are filename patterns that typically indicate OpenAPI specs.

Functions

func IsOpenAPIFile

func IsOpenAPIFile(path string) bool

IsOpenAPIFile returns true if the path looks like an OpenAPI specification.

func MatchGlob

func MatchGlob(path, pattern string) (bool, error)

MatchGlob is the exported version of matchGlob.

func ResolveSpecs

func ResolveSpecs(args []string, recursive bool, include, exclude []string) ([]string, error)

ResolveSpecs resolves file arguments to a list of OpenAPI spec files. It handles:

  • Explicit file paths
  • Glob patterns (e.g., "api/*.yaml")
  • Directories (with recursive flag)

The include/exclude patterns filter the results.

Types

This section is empty.

Jump to

Keyboard shortcuts

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