apispecs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package apispecs finds an organisation's OpenAPI and Swagger descriptions in a working tree and reads them through the one shared module (github.com/Vulnetix/vdb-openapi), so the CLI, the backend and the console all agree on what a document says whatever version it is written in.

It is the engine behind `vulnesis api discover`. Finding specs in files is safe and needs no network: the command never sends a request to a host unless the user passes an explicit --url.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generators

func Generators(dependencyNames []string) []detect.Generator

Generators returns the spec-generating frameworks named in a dependency list (for example a go.mod or package.json's dependency names), so a repo that builds its spec at runtime is reported even when no file is committed.

func Summary

func Summary(f Found) string

Summary is a one-line description of a found spec for the command's output.

Types

type Found

type Found struct {
	// Path is relative to the scanned root.
	Path     string
	Document *oas.Document
	// Raw is the file's bytes, uploaded unchanged so the server re-reads them.
	Raw []byte
}

Found is one spec read from a file.

func Discover

func Discover(root string) ([]Found, error)

Discover walks root for spec files and reads each through vdb-openapi. A file whose name looks like a spec is always read; any other .json/.yaml under the size cap is sniffed first, so a spec named oddly is still found without parsing every manifest in the tree. Vendored and generated trees are skipped.

Jump to

Keyboard shortcuts

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