openapi

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package openapi provides search functionality over a pre-processed Microsoft Graph OpenAPI index.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Path        string   `json:"path"`
	Method      string   `json:"method"`
	Summary     string   `json:"summary"`
	Description string   `json:"description,omitempty"`
	Scopes      []string `json:"scopes,omitempty"`
	Resource    string   `json:"resource,omitempty"` // e.g. "users", "groups", "messages"
}

Endpoint represents a single API endpoint in the index.

type Index

type Index struct {
	Endpoints []Endpoint `json:"endpoints"`
}

Index holds the full searchable OpenAPI index.

func LoadIndex

func LoadIndex(path string) (*Index, error)

LoadIndex reads and parses the pre-processed OpenAPI index JSON file.

func (*Index) Search

func (idx *Index) Search(query, resource, method string, limit int) []SearchResult

Search finds endpoints matching the given criteria. All criteria are ANDed together. Empty criteria are ignored.

type SearchResult

type SearchResult struct {
	Endpoint
	MatchReason string `json:"matchReason"`
}

SearchResult wraps an endpoint with a relevance indicator.

Jump to

Keyboard shortcuts

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