config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 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"`

	OpenAPI *OpenAPIConfig `yaml:"openapi,omitempty"`
	Export  *ExportConfig  `yaml:"export,omitempty"`
	Import  *ImportConfig  `yaml:"import,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.

func (*Config) ValidateExport added in v0.1.0

func (c *Config) ValidateExport() error

ValidateExport checks the export section for the export command.

func (*Config) ValidateGlobal added in v0.1.0

func (c *Config) ValidateGlobal() error

ValidateGlobal checks that the required global fields are present.

func (*Config) ValidateImport added in v0.1.0

func (c *Config) ValidateImport() error

ValidateImport checks the import section for the import command.

func (*Config) ValidateOpenAPISync added in v0.1.0

func (c *Config) ValidateOpenAPISync() error

ValidateOpenAPISync checks the openapi section for the openapi-sync command.

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

DocLinks configures automatic documentation link injection.

type ExportConfig added in v0.1.0

type ExportConfig struct {
	OutputDir    string   `yaml:"output_dir"`
	Collections  []string `yaml:"collections,omitempty"`
	Environments []string `yaml:"environments,omitempty"`
	Pretty       bool     `yaml:"pretty"`
}

ExportConfig holds configuration for the export command.

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 ImportConfig added in v0.1.0

type ImportConfig struct {
	InputDir     string              `yaml:"input_dir"`
	Collections  *ImportEntityConfig `yaml:"collections,omitempty"`
	Environments *ImportEntityConfig `yaml:"environments,omitempty"`
}

ImportConfig holds configuration for the import command.

type ImportEntityConfig added in v0.1.0

type ImportEntityConfig struct {
	Names    []string `yaml:"names,omitempty"`
	Strategy string   `yaml:"strategy,omitempty"`
}

ImportEntityConfig holds per-entity-type import configuration.

type OpenAPIConfig added in v0.1.0

type OpenAPIConfig struct {
	Path            string                    `yaml:"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"`
}

OpenAPIConfig holds all configuration for the openapi-sync command.

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