config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Type       string          `yaml:"type"`
	Attributes []AuthAttribute `yaml:"attributes,omitempty"`
	// Propagation controls how auth is applied to child folders and requests.
	// When set to "inherit", all folders and requests (except those with an
	// explicit folder_override) will have their auth cleared so they inherit
	// from the collection-level auth. Items with type "noauth" are left
	// untouched. Omit this field (or leave empty) to preserve the current
	// behaviour where each item keeps whatever auth was set previously.
	Propagation string `yaml:"propagation,omitempty"`
}

Auth holds the authentication configuration for a collection or folder.

type AuthAttribute

type AuthAttribute struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
	Type  string `yaml:"type,omitempty"`
}

AuthAttribute is a key/value pair for a Postman auth method.

type Config

type Config struct {
	PostmanAPIKey string `yaml:"postman_api_key"`
	WorkspaceID   string `yaml:"workspace_id"`

	OpenAPIPath string `yaml:"openapi_path"`
	BaseURL     string `yaml:"base_url"`

	SanitizeEnums bool      `yaml:"sanitize_enums"`
	DocLinks      *DocLinks `yaml:"doc_links,omitempty"`

	CommonHeaders []Header `yaml:"common_headers,omitempty"`

	Auth    *Auth    `yaml:"auth,omitempty"`
	Scripts *Scripts `yaml:"scripts,omitempty"`

	FolderOverrides map[string]FolderOverride `yaml:"folder_overrides,omitempty"`
}

Config is the top-level configuration structure.

func Load

func Load(path string) (*Config, error)

Load reads the YAML config file at path and applies environment variable overrides for secrets.

type DocLinks struct {
	BaseURL string `yaml:"base_url"`
}

DocLinks configures automatic documentation link injection.

type FolderOverride

type FolderOverride struct {
	Auth    *Auth    `yaml:"auth,omitempty"`
	Scripts *Scripts `yaml:"scripts,omitempty"`
}

FolderOverride lets you customise auth and scripts for a specific folder (tag).

type Header struct {
	Key      string `yaml:"key"`
	Value    string `yaml:"value"`
	Disabled bool   `yaml:"disabled"`
}

Header represents a single HTTP header to inject into requests.

type Scripts

type Scripts struct {
	PreRequest string `yaml:"prerequest,omitempty"`
	Test       string `yaml:"test,omitempty"`
}

Scripts holds pre-request and test scripts.

Jump to

Keyboard shortcuts

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