openapi

package
v0.0.0-...-cbea048 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package openapi loads OpenAPI 3.x specs and maps them into Synapse graph IR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListSpecFiles

func ListSpecFiles(root string, ignoreDirNames []string) ([]string, error)

ListSpecFiles walks root and returns absolute paths of OpenAPI 3.x docs. Directories named in ignoreDirNames are skipped (defaults match parse.DefaultIgnoreDirNames).

func Load

func Load(path string) (*openapi3.T, error)

Load reads and parses an OpenAPI 3.x document from path.

func LoadBytes

func LoadBytes(data []byte) (*openapi3.T, error)

LoadBytes parses OpenAPI 3.x YAML or JSON from data.

func LooksLikeOpenAPI

func LooksLikeOpenAPI(data []byte) bool

LooksLikeOpenAPI reports whether data appears to be an OpenAPI 3.x document.

func OperationID

func OperationID(specPath, method, path string) graph.NodeID

OperationID builds a Phase-1 node id for an operation.

func OperationSymbol

func OperationSymbol(method, path string) string

OperationSymbol is the URI/legacy symbol for an HTTP operation (e.g. "GET /users").

func ParseFile

func ParseFile(absPath, relPath string) (parse.Result, error)

ParseFile loads path and returns graph IR. Relative path is used as Node.Path when relPath is non-empty; otherwise filepath.Base of path is used.

func SchemaID

func SchemaID(specPath, name string) graph.NodeID

SchemaID builds a Phase-1 node id for a component schema.

func ToResult

func ToResult(specPath string, doc *openapi3.T) parse.Result

ToResult maps an OpenAPI document into Synapse parse IR for the given repo-relative spec path (slash-separated).

Types

This section is empty.

Jump to

Keyboard shortcuts

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