specs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package specs provides embedded OpenAPI test specifications for use in tests and benchmarks. Specs are sourced from the original Telescope TypeScript test-files collection and cover multiple OpenAPI versions, formats, sizes, and error conditions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	Name    string
	Content []byte
	Format  openapi.FileFormat
	Version openapi.Version
	Lines   int
	Size    SpecSize
	Tags    []string
}

Spec is a single embedded OpenAPI test specification with metadata.

func All

func All() []Spec

All returns every registered spec.

func BenchmarkSpecs

func BenchmarkSpecs() []Spec

BenchmarkSpecs returns a curated set of specs for benchmarking: one per size tier (Small, Medium, Large, XLarge). These are self-contained specs that parse and index without external $ref resolution.

func ByName

func ByName(name string) Spec

ByName returns the spec with the given base name (without extension). Returns an empty Spec if not found.

func BySize

func BySize(size SpecSize) []Spec

BySize returns all specs of the given size category.

func ByTag

func ByTag(tag string) []Spec

ByTag returns all specs that have the given tag.

func JSON

func JSON() []Spec

JSON returns all JSON-format specs.

func YAML

func YAML() []Spec

YAML returns all YAML-format specs.

func (Spec) LanguageID

func (s Spec) LanguageID() string

LanguageID returns the LSP language ID for this spec's format.

func (Spec) URI

func (s Spec) URI() string

URI returns a file:// URI for this spec, suitable for use with gossip's document store.

type SpecSize

type SpecSize int

SpecSize categorises a specification by approximate line count.

const (
	Small  SpecSize = iota // <100 lines
	Medium                 // 100-500 lines
	Large                  // 500-2000 lines
	XLarge                 // >2000 lines
)

func (SpecSize) String

func (s SpecSize) String() string

Jump to

Keyboard shortcuts

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