petstoretest

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package petstoretest provides an in-memory HTTP server that implements the subset of the Swagger Petstore API tcli's example pipelines exercise. Intended for CI integration tests replaces the external petstore.swagger.io dependency with a fast, deterministic local server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer() *httptest.Server

NewServer returns a running httptest.Server serving the pet endpoints under `/v2/`. Callers must call Close(). Each server has its own in-memory store, so tests are isolated from one another.

Types

type Pet

type Pet struct {
	ID        int64    `json:"id"`
	Name      string   `json:"name"`
	PhotoUrls []string `json:"photoUrls"`
	Status    string   `json:"status,omitempty"`
	Tags      []any    `json:"tags"`
	Category  any      `json:"category,omitempty"`
}

Pet mirrors the minimal shape addPet accepts and getPetById returns. Fields not used by tcli pipelines are not included.

Jump to

Keyboard shortcuts

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